To figure out how to keep the chest from flying off into infinity, we need to save where it started and keep checking if it has moved far enough before stopping it.
- Create a new variable above the
startingPositionwhich is equal to
- In the
startfunction, add a line that sets your
startingPositionvariable to this entity’s world position.