Hi, thanks for passing by!
So i’ve begun setting up blueprints in order to get quake-like acceleration when in slopes. So far, it looks like in this screenshot.
This is on event tick, the variable speed is fed into maxwalkspeed in another blueprint.
So far, whenever my character is on a slope, he gets boosted, whatever the direction he’s going in is. I’d like him to be boosted only while going downwards. I think my method is a bad one. Could anyone help me come up with a better idea?
Hey! So i tried doing that, but it doesn’t really solve my problem! I can tell if the floor is at an angle but not if the character is moving downwards or upwards, just like before!
Hi,
you will have to calculate the angle of normal vector of plane and a player character.
in current situation, i guess, it won’t be meeting the condition, as rotation will be constant ‘0’ .
Although this is an old question, I am posting the solution I worked out.
Basically, subtract the current player position from the last player position and normalize it. That is your movement direction. Now make a dot product between the movement direction and the world up axis (for example (0,0,1)) and this gives you a value between -1(downwards) and 1(upwards). Also works for moving sidewards on a slope which gives you something close to zero (basically not moving upwards or downwards).
I multiply that value with 90 and feed it into a float curve for finetuning the slope factor. For example my float curve points are (time/value) -90/2, -10/1, 10/1, 45/0.5, 50/0.