Announcement

Collapse
No announcement yet.

positioning an emitter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    positioning an emitter

    I'm trying to spawn an emitter depending on the rotation of a pawn

    i want it to spawn on the ground just in front and to the right of it..

    i can get the emitter to spawn on the ground but can seem to get to rotate around the pawn location dending on which direction it facing

    i've tried like this with only limited success any surgestions?

    Code:
            local vector EffectPos;
       
    
            Effectpos = location + vector(rotation) + Vect(128,0,-80);
             
            Spawn(class'MyEmitter',,,EffectPos ,rotation);

    #2
    Not sure what class you're doing this in - but if you have a reference to the pawn, "myPawn" or something, then just change your last line to this:
    Code:
    Spawn(class'MyEmitter,,,EffectPos,rotation).SetBase(self);

    Comment


      #3
      Code:
      local vector WorldRight;
      WorldRight= vect(0, -1, 0) >> Rotation;
      
      Spawn(class'MyEmitter',,,(Location * WorldRight + 128) - Vect(0,0,80),Rotation);
      It will spawn infront to the right for you

      Comment


        #4
        thanks for the feed back but unfortunatly neither seems to work the first doesnt seem to have no effect and the second gives me a compile error type not compatilbe with " + "

        Comment


          #5
          Correct. Location is a vector, which exists out of 3 integers, which are x, y and z. If you want something to be 128 units higher, you should do:

          Code:
          Location *  WorldRight + Vect(0,0,128)

          Comment


            #6
            Oh i have them in the wrong order lol, try:
            Code:
            
            local vector WorldRight;
            WorldRight = vect(0, -1, 0) >> Rotation;
            Spawn(class'MyEmitter',,,(Location + 128 * WorldRight) - Vect(0,0,80),Rotation);
            
            And actually this will spawn exactly to the right, if u wanted it forward and slightly to the right change vect(0, -1, 0) to vect(0, -0.5, 0)

            Comment


              #7
              Originally posted by Nov4
              Correct. Location is a vector, which exists out of 3 integers, which are x, y and z.
              Three floats, even. Rotations consist out of three integers.

              Comment

              Working...
              X