Download

Direction-dependent MaxSpeed for character movement component.?

I am trying to do a movement system where max speed is dependent on direction. I have a set max speed for each “main” direction (Left, right, Forward and Backward), and the MaxSpeed of directions between those is an intermediate value, of the adjacent directions’ proportional to the angle of the direction (The closer the movement direction is to one of the main directions, the bigger the weight of that directions value. What would be the simplest way to calculate the speed for a given direction?
The speeds are currently stored as floats in an attribute set in order to be affected by gameplayabilities.
Thank you for your time.

I think map in range node would be what you need.
For eg. for direction between forward and right, first you map your angle to 0-90 degrees, then map resulting speed to speed between forward and right.
To get direction in degrees between forward vector you either use get direction node (for characters) or calculate it by using dot product and arcus cosinus. Dot product of 2 vector is cosinus beetwen them.

Didn´t know about this node, will check it, thanks.