Topic was automatically imported from the old Question2Answer platform.
Asked By
Ogeeice
I have a player of type kinematicbody3d and a room of starticbody3d with an area3d attached to the room node,I want random animations which can be either glass_fall or tv_switch_on to play upon the player entering the room.Does Godot have an easy way of doing this.
Maybe you can use the Area3D node to detect when the player enters the room. Then set a signal to fire off an animation randomly, e.g.
func _on_area3d_enter():
if randf() > 0.5:
glass_fall()
else:
switch_tv_on
You can fine tune the randf() > some_number part by using different ranges between 0.0 and 1.0.