0 votes

Hello,

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.

Cheers.

in Engine by (44 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 (22 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 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 webmaster@godotengine.org with your username.