Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class RigidbodyExtrapolator : MonoBehaviour
- {
- public new Rigidbody rigidbody;
- void FixedUpdate()
- {
- transform.Translate(-rigidbody.velocity * Time.fixedDeltaTime, Space.World); // Cancel out the force applied by the rigidbody
- }
- void Update()
- {
- transform.Translate(rigidbody.velocity * Time.deltaTime, Space.World); // Apply the rigidbody force
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement