lets imagine everything is in 2D - i need to know the speed of the player (actually it would be better using eye position) on my screen (i dont need any unit of measurement) - if he is moving straight forward to me it wont change a lot cuz on my screen he is still on about the same spot. if he is moving close to me he will be moving on my screen very fast, if he is moving at the same speed from a bigger distance he will be moving slower on my screen. note that i dont want the facing direction to effect it at any way.
To find the relative velocity of any object you just subtract the two velocities, if you want to find the angle that’s a little more tough and requires trigonometry to learn the basics i would suggest you go to
h ttps://www.dummies.com/education/science/physics/how-to-find-vector-components/
also wtf i swear i was able to post links today.
ill explain it better (look at edit)
There is no such thing (to my knowledge) in physics, because the player is still moving and you can still see him moving in the same speed, the only difference is that for humans it’s hard to see distances when they are further away or from different angles, so naturally we tend to think that there could be a way of explaining it. But there is no explanation other than our brain is dumb.
What is the goal of this? Your description is really abstract, unsure what this would accomplish.
im making a score for trickshots mode and one of the things i wanted to effect the score for the shot is the speed the victim was moving from ur view but i think ill just give up on that and use relative velocity instead, i have a problem with this too tho - how do i turn a velocity which is a vector to 1 number that represents the speed
In Overwatch a vector is (usually) just a position or a rotation if it’s a local vector sometimes, not a velocity. if you just want the number you can use speed of or you can use speed of in direction if you want to get the components of the speed and calculate it yourself but there’s no point of doing that, also you shouldn’t use relative velocity for this gamemode because sometimes it’s minus and it really does not indicate the difficulty of the shot because if you and another player are moving at the same speed the shot is still a lot harder to hit than if you were both standing still.
in addition to relative velocity im also using speed of the event player, distance between the target and dmg dealt so i think reltaive velocity will be good, but is still need a way to make the 3 components of a velocity 1 number
By the 3 components do you mean x y and z?
yes sdfgsuidfhupoikd
So you can just use speed of, it will give you the same result, i wouldn’t recommend calculating them yourself because it takes it some time to do complicated math.
im talking about the relative velocity - when i cauculate a relative velocity i get 3 numbers - i need to turn them into 1
It’s the same thing i told you, just subtract the other guy’s velocity from yours.
when i cauculate a relative velocity i get 3 numbers - i need to turn them into 1
Sorry i meant subtract your velocity from his.
How do you calculate relative velocity then?
If you want to turn three components of velocity to one you should do:
actions
Square Root(Absolute Value(Add(Raise To Power(Speed Of In Direction(Event Player, Vector(0, 0, 1)),2), Add(Raise To Power(Speed Of In Direction(Event Player, Vector(1, 0, 0)), 2), Raise To Power(Speed Of In Direction(Event Player, Vector(0, 1, 0)), 2))))
but because the math is bad sometimes it will just be 0.
thx ill try it : D at first i just did XYZ but the problem in that was that if any 1 of them was 0 everything would be equal to 0
But why do you need it i still don’t understand?
i want the absolute value of the speed of the victim reltive to the event player be one of the things that will effect the score he will get for the shot