I want to implement a jumping feature to the demo project.
To accomplish that I want to use a raycast, to check whether the player is mid air or grounded.
here the editor link: https://playcanvas.com/editor/project/490668
As I said, I want to check if the player is grounded or not. For this I have a empty child object attached to the parent object. Now I use the raycastFirst() start position of the player and end position of the child object which is underneath the player. This works, however if you spin or go in one direction the child objects starts to roll with the parent and it’s no longer pointing to the floor.
(I draw a line to represent the raycast visually)
TL;DR I want to be able to have the child object point always down.
Or, is it possible for the raycastFirst() method to set a length of the raycast, this would solve my problem and would be more elegent.
If you need more informations, feel free to ask