PDA

View Full Version : Moving Forward



donamin
12-09-2010, 08:06 AM
hi every one.
i need my pawn to move forward while he's playing attack animation. i'm using AddVelocity function like this:


AddVelocity(Normal(Vector(Rotation)) * WorldInfo.Game.GameSpeed * 100, Location, class'DamageType');

but now i have problem with that. my character movement in ramps. i want him to move almost one step forward. but when he's standing on top of ramp, he flees down of the ramp quickly!

how can i solve this?

is there a function which i can use instead of AddVelocity?

daimaku
12-09-2010, 08:28 AM
look the playerController class and search state PlayerWalking and see



Pawn.Acceleration


hope this help you.

donamin
12-09-2010, 08:55 AM
i'm using this code for pushing pawn forward:


local vector speed;
local Rotator delta;
speed = Normal(Vector(Rotation)) * WorldInfo.Game.GameSpeed * 100;
speed.Z = 0;
delta.Pitch = 0;
delta.Roll = 0;
delta.Yaw = 0;
MyGameController(Controller).ProcessMove(WorldInfo .Game.TimeSinceLastTick, speed, DCLICK_None, delta);
MyGameController(Controller).PlayerMove(WorldInfo. Game.TimeSinceLastTick);

but it's not working.
what's your idea?

Saishy
12-09-2010, 11:32 AM
i'm using this code for pushing pawn forward:


local vector speed;
local Rotator delta;
speed = Normal(Vector(Rotation)) * WorldInfo.Game.GameSpeed * 100;
speed.Z = 0;
delta.Pitch = 0;
delta.Roll = 0;
delta.Yaw = 0;
MyGameController(Controller).ProcessMove(WorldInfo .Game.TimeSinceLastTick, speed, DCLICK_None, delta);
MyGameController(Controller).PlayerMove(WorldInfo. Game.TimeSinceLastTick);

but it's not working.
what's your idea?
I have no idea what are you doing.

Override ProcessMove instead of calling it, and change it to fit your desire.

donamin
12-10-2010, 12:05 AM
I have no idea what are you doing.

Override ProcessMove instead of calling it, and change it to fit your desire.

are you sure i should override it? i just need my pawn to move forward a little while attacking. i don't want to change it's movement style.

can you tell me what exactly processmove is used for?

rjmyth
12-10-2010, 06:32 AM
you should have a look at the crouching functions that are built in as currently whilst crouched you cannot fall off a ledge.

Blade[UG]
12-10-2010, 06:01 PM
If you didn't know what it was used for, why were you calling it? :D

Crouching/Walking uses native functionality to prevent phys_walking from taking you off a ledge, as far as I know.

Is there some reason why the various alternative methods aren't working? The ones we've suggested, such as Move(), MoveTo(), Root Motion, setting Acceleration or Velocity ...

donamin
12-10-2010, 10:13 PM
i should finish this in one weeek and i have no idea what root motion is! so i have no time for working with root motion right now! setting velocity and acceleration has some problems in ramps. my character goes forward almost 10 steps instead of 1 in ramps! do you know any solution for that?

Blade[UG]
12-11-2010, 05:48 AM
use smaller velocities ...

donamin
12-11-2010, 12:02 PM
no i mean character moves the correct distance in smooth surfaces but when he goes on ramps, this distance changes!

a_karimi
12-11-2010, 12:19 PM
Pointing the velocity you give to addVelocity() in a direction perpendecular to the base's normal vector wouldn't solve this?

donamin
12-11-2010, 02:01 PM
i didn't get that. could you explain more?

a_karimi
12-12-2010, 02:35 AM
I mean:

1. Do a normal trace downward and get the hit normal.
2. Do a getAxes(Rotator(dir), X,Y,Z) on the direction you want the pawn to be pushed toward.
3. pushVelocityDir = normal(hitNormal cross Y);
4. addVelocity( pushVelocityMagnitude * pushVelocityDir );

I don't know if that would solve your problem but this would give you a velocity parallel to the ramp and should have the same effect as on the ground.

I hope it would help :)

donamin
12-12-2010, 01:43 PM
ok. i'll work on it. thanx a lot ali :)