- Home /
Calculate Position of Rigidbody after applying Force
I am currently working on a project where the player has a rigidbody component attached to him. The player can use a trampoline to jump higher or further. The force of the trampoline is applied normal to the trampoline-rotation (I have no better explanation for this. Sorry). Here is the trampoline script:
using UnityEngine; using System.Collections;
public class Cube_Impulse : MonoBehaviour{ public float impulsePower;
void OnCollisionEnter(Collision collision){
Rigidbody collisionRigidbody = collision.rigidbody;
if(collisionRigidbody != null){
collisionRigidbody.AddForce(impulsePower * gameObject.transform.up, ForceMode.Impulse);
}
}
}`
My Question is: How could I calculate the players position after he jumped onto the trampoline.
Comment