Hey,
as stated in the title, I need a function which returns me a Vector with the given angles and velocity.
Its similar to creating a trigger_push trigger, where you enter the "pushdir" and speed, for example "0 -90 0" and "1250".
I think it would look most likely like (x, y, z) = (0, -1250, 0) but how could I calculate it for weird angles, like "30 0 45" angle and "1330" speed.
Thanks
Calculate Vector by giving angles and velocity
Re: Calculate Vector by giving angles and velocity
I think you are looking for Player.view_vector or at least the math of it. Then you normalize the result and multiply it with the speed.
Edit: You can also directly set the length of the view vector.
Edit: You can also directly set the length of the view vector.
Syntax: Select all
vec = player.view_vector
vec.length = 1250
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 86 guests