GDevelop
GDevelop copied to clipboard
Collision check and distance check does not work between child objects of custom object and scene object
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
The position of member objects is relative to the position of the custom object container which is normal. However it is cause collision and distance checking not to work between child objects of custom objects and scene objects.
Most other game engines deal with this problem with providing functions to get/set local and world position of objects. Local position of the object is relative to its parent/container. World position is the position in the scene.
I think collision checking and distance checking should always take in to account world position and never the local position Alternatively could use an extra parameter in collision and distance events and expression to set if we want to use local or world position of the object.
Example that reproduce this problem: custom_object_bug.zip
Steps to reproduce
- Create a custom object with at least 2 child objects.
- Add a scene object
- Pass scene object to custom object extension using a function parameter
- In custom object extension function check distance between 1 child object and the scene object.
GDevelop platform
Desktop
GDevelop version
5.4.215
Platform info
OS (e.g. Windows, Linux, macOS, Android, iOS) macOS
OS Version (e.g. Windows 10, macOS 10.15) 15.0.1
Browser(For Web) (e.g. Chrome, Firefox, Safari) N/A
Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21) Desktop
Additional context
No response