Hey guys and gals!
I am struggling with keyboard input, as only one key works at a time, or at least in my situation...
my controller:
my KActorSpawnable:Code:function PlayerMove( float DeltaTime ) { LogInternal("Move Player"); if (Ball != None) { LogInternal("Ball Alive!!"); Ball.AxisInput(PlayerInput.aStrafe,PlayerInput.aBaseY); } }
Most is from Whizzle, any ideas?Code:simulated event AxisInput(float AxisRight, float AxisUp) { MovementDirection.X = AxisRight * strafeSpeed * -1; MovementDirection.Y = AxisUp * fwSpeed; MovementDirection = Normal(MovementDirection) * strafeSpeed; } simulated function AddInputForce(float DeltaTime) { local vector PushVector; local float InputForceMultiplier; // If the player is barely holding the joystick, don't allow player to move from that input // Basically allows for hard coded deadzone if( VSize(MovementDirection) < 0.2f ) return; // Change the input force multiplier based on a curve InputForceMultiplier = EvalInterpCurveFloat( InputPushAmountCurve, VSize(Velocity) ); // Store the actual direction that the ball should move PushVector = MovementDirection; // Only allow the player to move up in the Z direction a small amount depending on what InputThresholdZ is set to PushVector.Z = FMin(InputThresholdZ, PushVector.Z); // Increase the direction of the push by the multipliers (Constant + Curve) //PushVector.Y *= InputPushAmountY * InputForceMultiplier; PushVector.Z *= InputPushAmountZ * InputForceMultiplier; // Actually add the force to the Ball over a few frames StaticMeshComponent.AddImpulse(PushVector * DeltaTime); }
Thanks guys!
T



Reply With Quote

Bookmarks