0 votes


I have a character and character has a shield. When character is attacked and if player is pressing down b button the shield effect gets triggered.

This gets triggered no matter in which direction the shield is facing, even if away from the enemy. I would like to limit this to maybe just 90 degrees left and 90 degrees right. I suspect this is some trigonometry solution. Tried a lot with move direction, degrees, gradiants, etc.

Any idea ? Simple solutions also welcome.


in Engine by (51 points)

The dot product is what you want to use I think! Take a look at the docs, there's a good explanation. If you still need help, don't hesitate! https://docs.godotengine.org/en/stable/tutorials/math/vector_math.html#dot-product

1 Answer

0 votes

Activate/deactivate predefined in editor collision shapes when pressing "block"

by (26 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.