I use standard collision check pre/post. But I need to be able to check if a collision occurs at the moment of creation. i.e. as the object is spawned potentially ontop another object. so pre/post don’t work as the collision has already happened; any help appreciated
There’s a little “trick” to this that should work (I’ve used it before). When you create the new object, quickly deactivate it and reactivate it in 2 consecutive lines:
[lua]
object.isBodyActive = false
object.isBodyActive = true
[/lua]
This should trigger a collision event when the object regains sensory state… and likely it will trigger a collision event on the other object when it goes inactive, if you’re sensing collision on it too (not just the object that’s being newly placed).
There’s a little “trick” to this that should work (I’ve used it before). When you create the new object, quickly deactivate it and reactivate it in 2 consecutive lines:
[lua]
object.isBodyActive = false
object.isBodyActive = true
[/lua]
This should trigger a collision event when the object regains sensory state… and likely it will trigger a collision event on the other object when it goes inactive, if you’re sensing collision on it too (not just the object that’s being newly placed).