0 votes

I'm very new to Godot so excuse me if I'm missing something obvious. I tried to implement a character that uses a rayshape for its ground collision. When I create a scene with a KinematicBody and any other shape it has no problem colliding with the StaticBody that I set up (both bodies only have CollisionShapes as children). However when I switch to RayShape the KinematicBody just goes right through it.

Looking at the manual page for 3D RayShapes, it says:

A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It’s often useful for characters.

Why is my RayShape then puncturing the StaticBody when it's part of a KinematicBody? Am I meant to read the collision manually through GDScript and separate it myself? If so, that doesn't really match the description in the manual and I think it would be redundant considering RayCasts already exist and have that behavior.

EDIT:
So after looking through the documentation further I realized my issue was with my call on "move_and_collide"

move_and_collide ( Vector3 rel_vec, bool infinite_inertia=true, bool exclude_raycast_shapes=true, bool test_only=false )

exclude_raycast_shapes is true by default and needs to be set to false to respond to rayshapes.
But now another issue arises in that while the rayshape now responds to its intended function of separating the physics body, the move_and_collide function does not report any collision. I'm not sure whether this is the intended behavior or not.

asked May 16 in Engine by Doerrf (12 points)
edited May 16 by Doerrf

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 How to use this Q&A? before posting your first questions.