I have a First Person Controller advancing along a floor. When I get to a certain point I want to move the entire floor and the FPC backwards to a different location.
If I have Moving Platform enabled, the FPC is flung about 1000m backwards when I do this (it took me a while to work out that this bizarre thing was happening!). If I disable Moving Platform it is OK but when I re-enable Moving Platform, the FPC is then flung.
I’m wanting to use moving platforms in the game so don’t want to permanently disable it. I’ve tried the following to no avail:
-
switching MP off and on again (the FPC is flung immediately)
_playerTransform.GetComponent(CharacterMotor).movingPlatform.enabled = true;
-
switching MP off and on after a delay (the FPC is flung when I switch back on)
-
setting platformVelocity to zero (no effect)
_playerTransform.GetComponent(CharacterMotor).movingPlatform.platformVelocity = Vector3(0,0,0);
-
setting character motor velocity to zero (no effect)
_playerTransform.GetComponent(CharacterMotor).movement.velocity = Vector3(0,0,0);
-
setting character motor frame velocity to zero (no effect)
_playerTransform.GetComponent(CharacterMotor).movement.frameVelocity = Vector3(0,0,0);
Can anyone suggest how I do this simple thing - just moving the character and floor to a different location without anything getting flung across the scene.
Thanks!