-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Get specific collisionShape when KinematicBody has multiple collisionShapes #446
Comments
This seems like a bug. Report it on the Godot Engine Github: |
Well the function and signal are working as intended it seems, there just is no feature currently to get reference to the collision shape |
That totally sounds like what you need. Then use |
@KoBeWi that seems to provide the id of the collision shape that is attached to the player Area, not the other "enemy" collision shape. Which I already have since my player is "attacking/hitting" from the area collision shape. What I need is the collision shape that my collisions shape hit. (one or more, of many, since the enemy kinematic body can have many collision shapes as children) |
Uh, I think it should've been |
@KoBeWi I had tried this before also, this only gives the id of first collision shape, no matter which collision shape i am entering |
So yeah, I tested it and there's a bug. Also turns out a similar bug was already reported: godotengine/godot#19290 |
Describe the project you are working on:
I am working on a block building vehicle prototype. A vehicle can have thousands of blocks. There can be many vehicles per game.
I have one kinematic body for a vehicle so that I can move it, then I load all the blocks in as collision shapes with mesh instances within them.
Describe the problem or limitation you are having in your project:
I cannot seem to get reference to the collision shape I am "hitting": My player has a melee attack block, it has an attack script with an area and a collision shape.
I have tried
get_overlapping_bodies()
and the signal
func _on_Area_body_shape_entered(body_id, body, body_shape, area_shape): print(body_id, body, body_shape, area_shape)
I am always getting reference to just the kinematic body. But it does not seem possible to get the collision body I am actually hitting.
Describe how this feature / enhancement will help you overcome this problem or limitation:
provide reference to the specific collision shape when a kinematicbody has multiple collision shapes
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
not applicable
Describe implementation detail for your proposal (in code), if possible:
not applicable
If this enhancement will not be used often, can it be worked around with a few lines of script?:
The work around would be to check each collision body for collision, but thats on potentially 10,000+ blocks. Also I dont want my blocks to have any attack checking responsibility.
Is there a reason why this should be core and not an add-on in the asset library?:
It is fundamental to reference a node responsible for collision, no matter what node setup.
The text was updated successfully, but these errors were encountered: