View Full Version : Applying Velocity to KActor
11-15-2009, 06:28 PM
Is there a way to adjust the velocity of a KActor after you have applied an Impulse.
I want to cap the velocity or add an acceleration in X / Y but calling this:
Velocity = newVelocity;
Velocity.X += Spin.X;
Is having no effect
04-01-2011, 08:15 AM
Did you ever solve this problem? I'm running into the same thing.. Anyone have a clue?
04-01-2011, 09:44 AM
You have to apply the velocity change to the mesh component, not the KActor itself.
(I'm not sure if this is the real code or not but it should get you in the right direction)
StaticMeshComponent.Velocity = NewVelocity;
04-01-2011, 10:41 AM
StaticMeshComponent.SetRBLinearVelocity or SetRBAngularVelocity. That is to set the velocity.
04-03-2011, 08:11 PM
KActors (or any actor with it's physics set to PHYS_RigidBody) can only have their velocity directly modified by accessing the primitive component being used to calculate the rigid body physics.
StaticMeshComponents are typically used to calculate rigid body physics, and are (eventually) descended from PrimitiveComponent, which has the following function:
* Set the linear velocity of the rigid body physics of this PrimitiveComponent. If no rigid-body physics is active, will do nothing.
* In the case of a SkeletalMeshComponent will affect all bones.
* This should be used cautiously - it may be better to use AddForce or AddImpulse.
* @param NewVel New linear velocity to apply to physics.
* @param bAddToCurrent If true, NewVel is added to the existing velocity of the body.
native final function SetRBLinearVelocity(vector NewVel, optional bool bAddToCurrent);
For example, the following code would cause a KActor stop moving.
The PrimitiveComponent class has a number of functions that pertain to accessing or manipulating rigid body physics, most of them can be easily identified by looking for the letters RB (for Rigid Body) in the function name.
04-03-2011, 08:20 PM
I think KActor does have a Maximum Velocity variable that can be enabled
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.