I have a CharacterBody3D (player) with a camera on it which I can move through wasd.
I have a 3D model from Blender with an animation.
I have an Area3D with a CollisionShape3D nested.
I would like to be able to trigger the 3D model animation when the player enters the 3DArea.
I have no idea what to use and how to use.
The area3d has a signal called _on_body_entered which gets emitted when a body enters its area. You can use this to start an animation.
If you dont know how to use signals i suggest you either watch a tutorial or read the docs
I’ve solved the signal thing, now I need to trigger the animation. But I’m having some issues with the Area3D and Collision shape scaling. When I select one or the other they are quite different.
Scaling? It is usually a bad idea to scale physics bodies non-uniformly, instead use the size controls in the inspector for that resource, or the red dot gizmos that show in the editor.
If you have the signal connected, now you need to find out if the entering body is the player, then play their animation.
func _on_area_3d_body_entered(body: Node3D) -> void:
if body.name == "player":
body.play_animation_for_area_thing()
I used those but when I select them individually they have very different shapes. For instances the Collision node is huge but the Area one is really slender.
The body_entered signal emits which body entered the area, in this case a CharacterBody3D I’ve compared the name to “player” assuming your player is one with a script that includes a function to animate named “play_animation_for_area_thing”. You would replace that function your own function, probably one with a Tween or AnimationPlayer.play call.