I have a moving platform that I’ve applied a rigid body and physics material to so that the player moves along with the platform as it moves. I tweaked the settings so that the player is able to move at a decent speed but it’s still a bit slower than when on a non-moving platform. This slow down only occurs when the player is moving in the same direction as the platform. Moving in any other direction is normal speed.
I had the idea to set a trigger on the platform so when entered, it would apply an additional force to the player to counteract the gravity and increase the speed that the player moves. It’s not working and I’m not sure if it’s an issue with my code or my (lacking) knowledge of physics.
void OnTriggerEnter (Collider col){
if (col.tag == "MovingPlatform") {
// something to check if player is moving in the direction of platform
GetComponent<Rigidbody> ().AddForce (transform.forward * velMultiply, ForceMode.Acceleration);
}
Is this possible or should I do it a different way?