#bouncing triggers raycasts
1 messages · Page 1 of 1 (latest)
Why not check if the dice is done rolling with sleeping? Instead of all the velocity stuff
Never heard of this
And make sure you get the collision layers & masks right, otherwise you might fire off multiple collisions when 2 dice happen to land next to each other
Time to read the docs then?
of course
Sleeping don't work as it should
I think in the first frame of being in air, the dice doesn't "move" so sleeping is triggered
Adjust how you spawn it / give it force, so sleeping works?
Checking for sleeping is really by far the easiest to make it work for you.
ah okay. I just changed the linear_velocity not giving a force.
Do I add the force correctly?
func _process(_delta):
if ka and sleeping:
for child in $"./RayCasts".get_children():
if child.is_colliding():
print(child.name)
elif ka:
print(linear_velocity)
if Input.is_action_just_pressed("roll_dice"):
position.y += 15
rotation += .....
apply_force(Vector3(0, -15, 0))
ka = true
Because I have still the bug, that sleeping is True in the first frame of my dice being in the air