The Crate Escape, carrying through
Took muuuuuch too long but, with the help of some friendly folks on the Godot Discord, I finally have my carrying working.
For those struggling with the same thing I did, to set the position of a RigidBody2D from code, there are 2 ways:
- In 'normal' code:
python
rb2d.set_global_position(newPos)
rb2d.move_and_collide(Vector2.ZERO) # update physics
- In
_integrate_forces(state):
python
state.transform.origin = newPos
The proof of the pudding is in the carrying it overhead!
https://youtu.be/G3OIR7b70eg
HTH!
Finishing early with hopes of an early (and earlier) start tomorrow. GL all!