Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // NOTE: Also needs the IntervalClampUpdate Script: https://pastebin.com/5CfSg4db
- public class IntervalClampHelper : MonoBehaviour
- {
- // Needs to be set to run before the default time: Edit/Project Settings/Script Execution Order
- #region Public Fields
- #endregion
- #region Private Fields
- private IntervalClampUpdate clamper; // The local interval clamper
- #endregion
- #region Unity Methods
- protected void Start ()
- {
- clamper = GetComponent<IntervalClampUpdate>();
- }
- protected void FixedUpdate ()
- {
- // Here we reset our world position at the start of the frame this allows
- // for us to modify transform.position while still getting the same clamping effect.
- transform.position = clamper.actualPosition;
- }
- #endregion
- #region Public Methods
- #endregion
- #region Private Methods
- #endregion
- }
Add Comment
Please, Sign In to add comment