#Problem too long for title
1 messages · Page 1 of 1 (latest)
You can either rely on get_tree().paused or create your own system for freezing the objects.
There's no single solution for this.
Ok
I was mostly wondering how would I make an if statement like “if the ray cast is touching this body, then do this.”
you can always call the is_colliding() method on the raycast, this will tell you if the raycast collides with something it is intended for.
You can create a method that is called and check if is_colliding() is true when you want to use your stun.
For more information on Raycast, check out the official documentation.
Raycasts have get_collider() to check what they are touching.
ok I’m not at home rn but I’ll try that
maybe you should try to use state machine, do the navigation thing in one state, and the animation in another.
there seems to be one small problem
oh im not doing it on the raycast, im doing it on the enemy
Same thing for what I said right above this message
Did you finish this tutorial? it teaches the basics of 3D movement.
https://docs.godotengine.org/en/stable/getting_started/first_3d_game/index.html
In this step-by-step tutorial series, you will create your first complete 3D game with Godot. By the end of the series, you will have a simple yet finished project of your own like the animated gif...
Add your Raycast3D to your character.
If you want to access the methods of a component such as the Raycast3D, then you must also address this component.
Here you are trying to access the methods of the Raycast without adding or addressing it.
I have written a function, there the raycast is addressed and it is queried whether the raycast collides with something, then I get the object with which I collide.
Choose what you need, either is_colliding() or get_collider(), then check if what comes back fits. With is_colliding it returns true or fals, with get_collider it returns null or the object you hit first with your raycast.
I just used both functions to show how to use them.
Without meaning any offense, I recommend doing a few tutorials first. You'll reach your goal faster.
i keep on forgetting information, the raycast is attached to a different body (the player) but im trying to make the enemy (creature) pick up on it when that ray cast is touching the enemy, ykwim?