|
Hello, I'm making a 2d platform game and my player's momentum is having problems. When I jump on a moving platform going up/right/left my character shoots in the direction the platform was going in much farther than a regular jump and he does not start falling down for a long time. Any help would be very appreciated. Thanks, zAk
(comments are locked)
|
|
I actually don't know what a physics walker script is... but I'm using the platform controller script from the 2DGameplayTutorialProject in the walkthrough. I found that applying a rigidbody component to the character and setting both drags to 30 helps, but It's only a temporary fix. Is there anything that can fix this for good? `class PlatformerControllerJumping { // Can the character jump? var enabled = true; function onJump () { velocity = 0; angularVelocity = 0; } } var jump : PlatformerControllerJumping; private var controller : CharacterController; // Moving platform support. private var activePlatform : Transform; private var activeLocalPlatformPoint : Vector3; private var activeGlobalPlatformPoint : Vector3; private var lastPlatformVelocity : Vector3; // This is used to keep track of special effects in UpdateEffects (); private var areEmittersOn = false; function Awake () { movement.direction = transform.TransformDirection (Vector3.forward); controller = GetComponent (CharacterController); Spawn (); } `
(comments are locked)
|

I would need a snippet of the walk and jump code to be of any use. Im going to assume your using a physics walker script?
I actually don't know what a physics walker script is... but I'm using the platform controller script from the 2DGameplayTutorialProject in the walkthrough. I found that applying a rigidbody component to the character and setting both drags to 30 helps, but It's only a temporary fix. Is there anything that can fix this for good?
`class PlatformerControllerJumping { // Can the character jump? var enabled = true;
function onJump () { velocity = 0; angularVelocity = 0; }
}
var jump : PlatformerControllerJumping;
private var controller : CharacterController;
// Moving platform support. private var activePlatform : Transform; private var activeLocalPlatformPoint : Vector3; private var activeGlobalPlatformPoint : Vector3; private var lastPlatformVelocity : Vector3;
// This is used to keep track of special effects in UpdateEffects (); private var areEmittersOn = false;
function Awake () { movement.direction = transform.TransformDirection (Vector3.forward); controller = GetComponent (CharacterController); Spawn (); } `