Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

[I already asked this question on the UDK forums, without much success though.]

I'm using a class derived from AIController to control my pawn in RTS-style. My problem is that the pawn does not have a fixed Location.Z so if his Velocity in X and Y direction changes the Velocity.Z also changes (for whatever reason). I have tried nulling the Velocity.Z in the tick method, using Move to move the character back to a constant height and some other things of which nothing had worked. How can I solve this?

share|improve this question
    
Maybe a silly question: is the pawn on the ground? Asked another way: is the Z velocity not caused by gravity? –  Phillip Jan 8 '13 at 7:57
    
Yes it is on the ground. The Z velocity is 0 until I change the velocity of the pawn in X and Y direction which makes it jump and finally fall back on the ground. –  Torax Jan 8 '13 at 19:17
    
Oh, so the Z vel is positive! Wow. How/where are you changing the Pawn's Velocity? Can you post some sample code? –  Phillip Jan 8 '13 at 20:39
    
I tried setting the Velocity directly but what I'm doing now is applying momentum to it using the TakeDamage method like this TargetPawn.TakeDamage(10, SomeController, TargetPawn.Location, Momentum, class'DamageType',, Self); where Momentum is a vector with its Z component set to 0. Both have the same result of also making the pawn lift off even though the added velocity/momentum in Z direction was 0. –  Torax Jan 11 '13 at 0:03
    
Unfortunately, I'm not really sure what's going on. I've got March 2012 UDK. I just tried using an Actor Factory to spawn an AIController/Pawn and using an exec function to set its Velocity to vect(200,100,0) and I didn't get any Z velocity. Are you using a Physics other than PHYS_Walking? Setting the velocity anywhere else inside your Controller or Pawn? I'd say stick logs in directly before and after you set Velocity. Also if you haven't already, use an exec function to do nothing more than set the Pawn's Velocity. –  Phillip Jan 11 '13 at 2:26

1 Answer 1

The problem seemed to be that I was using the a Terrain as ground even though it was flat and the height was not modified. I'm using a blocking volume now and it works just fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.