Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collision check and distance check does not work between child objects of custom object and scene object #7045

Open
1 task done
ddabrahim opened this issue Oct 12, 2024 · 1 comment

Comments

@ddabrahim
Copy link
Contributor

Is there an existing issue for this?

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

  1. Create a custom object with at least 2 child objects.
  2. Add a scene object
  3. Pass scene object to custom object extension using a function parameter
  4. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ddabrahim and others