Closed
Description
Godot version
4.0 dotnet
System information
Windows 10, Nvidia GTX 1660Ti, Vulkan
Issue description
I'd first like to say I'm not sure if this is a bug or if I'm just understanding the functionality wrong, I've been trying reddit, discord for days, nothing so I decided to come with it here.
I'd like to get the collision shape which collided during KinematicCollision from inside a CharacterBody3D, I found there's get_local_shape(index)
method but this method always returns only the 0 index CollisionObject.
If I'm using this wrong I'm sorry, is there some way to use this or something else to get the particular colliding shape?
Test project is in gdscript.
Thank you.
Steps to reproduce
- Play the project
- Wait until objects collide
- Read the output, it prints the first shape only (ChracterBodyShape1)
The local_shape_at_index prints the shape that should be colliding but it returns only the 0 index CollisionShape3D which is named CharacterBodyShape1, the shape which collided is CharacterBodyShape2 - Stop the project
- Move the CharacterBodyShape2 above CharacterBodyShape1 in the sceen tree so it's the first child of the CharacterBody3D node.
- Play the project
- Watch the Output again (again only the first shape this time ChracterBodyShape2 since you moved it up)
As you can see now it prints the colliding shape but only because it's the 0 index shape.