|Topic was automatically imported from the old Question2Answer platform.
I’ve been trying to code a way to efficiently move objects, and I’ve been flip flopping between going with physics or not going with physics… I basically have a grid, ex; 6x6 and trying to implement dragging and dropping an object on the board to another square. If the moved to square contains an object, move this object to the the dragged object’s original square. (move as in move visually, not teleport to.)
What would you guys recommend, using the physics engine or just detecting the collisions ‘manually’ and moving the static objects using positions? I think either:
- implementing following mouse pointers using physic forces. (is there a simple way to do this?). Then moving to non-collision layer and move to new spot via forces. (like move to mouse position, easy way to do this?)
- just using a static RigidBody2D and positioning, doing a manual detecting collisions/intersections and moving via multiple update positions in the physics update method (ex; move X pixels per frame until it reaches location).
I’m not quite sure which would be better… Suggestions? Thoughts? Thanks!