Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Mupp on April 14, 2018, 07:26:09 PM
-
I have an object that checks the slope under it by firing 2 raycasts every frame, one to the left of it and one to the right.
Now how can I create a "line" between those 2 vector3? I want to move the object along this line by pressing right, and to the opposite direction when pressing left. If possible by using set velocity.
-
Hi,
maybe you can use 'move toward' action?
-
No, these 2 points are on the object that's going to move.
Let me phrase differently.
I have 2 world points as vector3. I want the angle/direction from the line between these 2 points as a vector3.
I've tried vector3 operator angle, but that returns 0.
-
Bump time.
I still kinda need to know how to convert a velocity float, using a vector3 angle and get the result as a vector3.
-
I thought I already replied to this. Strange.
Here are two actions to get the direction between two points. You can use this as your direction for movement.
Use these actions to get the direction and use the normalize option. This will give you the 'heading" for the movement direction.
-
Nice, didn't think there were custom actions for this. Thanks. :)
But one thing though, I still don't understand how to apply the velocity to the normalized vector.
-
Try the action vector3 multiply.
Give it a value of 10 or more at first, just to see how it works.
-
Multiply? There's no way that's how you do it. If the direction is 0, 0, 0 then the magnitude would also be 0.
-
The direction would only be 0,0,0 if they were on top of each other.
-
Right, got it. Thanks. :)