+1 vote

Currently, I have a scene called "MovingArea2D". Its root is an Area2D and there is nothing else in this scene. It has a script attached to the root node and the script extends Area2D. All it does it run some basic code which calculates the velocity it's being moved at.

Now, I have a collision query which is strictly flagged for Area2Ds, but for some reason it does not register any collisions when I try instancing my scene and using it in place of regular Area2Ds.

Though, when I instance my scene, and then click "discard instancing" the collisions start working. I have a feeling this is not expected behavior in the system(a bug if I may call it), but if it is expected, I'd like to know how to achieve what I'm trying to do which is basically creating a unique Area2D derived node that I can reuse (rather than just always attaching a script).

The Collision query I'm making looks like this:

     _space_state = get_world_2d().get_direct_space_state()
    _query = Physics2DShapeQueryParameters.new()
    _query.set_shape(  shape_ed.get_shape() ) # provided param
    _query.set_transform( futureT ) #provided param
    self.collisions = _space_state.intersect_shape(_query, max_results)

And again, everything works unless the Area2D is instanced.

in Engine by (13 points)

Sounds like a bug, Godot version?

@eons surely a bug. Version is the newest version found in Steam

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.