now technicaly, velocity is speed + direction. that is, its only a velocity when both speed and direction are noted. what i need to measur is the speed of an object goin forward. however, this object turns. how can i measure the speed of this object only in terms of going forwards in relation to itself even if it turns?
use the speed from the get object info, or get the vector length of the velocities X,Y,Z, again found in the object info, both require physics to be enabled to work.
What Dasraiser said. If you use a vector, it will have a value in all three directions, x y and z. If your object is moving along the XY plane (no velocity in the Z direction) then at every point in time it will have an X component and a Y component. If you are moving fully in the Y direction, the x component will be zero, etc.
I haven't used the vectors in game yet, but from what I remember the coordinate system seems to be a bit flaky, so just some trial/error should get you the proper component (x y or z) for your application.
the limited knowledge i have on the maths tools, would not the vectors and speed data sources measure the speed as a total regardless of direction. what i need to record is the speed in a single direction, but this direction can change. imagin you are in a car. if that car is doing 20 miles per hour, and then turns, it is still doing 20 miles per our but in a different direction. this 20 miles per hour is forward momentum, dissregarding speed to the left or right. this is what i need to do with my object. record forward momentum while dissregarding left or right. even if the direction of that forward momentum changes, which it can as its not locked to the driving line. everything i try records the speed as a whole. that is, speed in all directions added up.
sorry if im not explaing this very well, i cant think to how to do it better.
the speed info is a total of the speed, the velocities are the vector in speed unit, i believe they're both in m/s (although speed maybe multiplied by some constant to give it some resolution)
as for the disregarding the left/right speed (aka skidding/etc), this happens in cars because the tires are facing the direction of the car...., so looking at the velocities, you will need to pick one where the normal of the cars direction matches the correct velocity ie if red pointing forward (x axis) then use velocity X.
one problem you may have is that no one axis is facing forward, due to the glue pivot being skewed, if this is the case, the best advice i can give is to unglue your object and place the glue pivot 1st with custom set and set in the correct rotation, this maybe easiest to do with world snapping set (check all snap boxes X/Y/Z and don't choose any snap object), then reselect the pivot and then start selecting the car members again, this will fix the pivot to the axis it was place at, also should remain in orientation if mass/center is then chosen.
hope this helps.
if the axis are object related thats easy enough, you just measure which ever axis is the right one. but if axis are world related, as your object turns, the "forward" axis changes. so measuring said axis would be useless. i have found a work around to my issue but this would be useful info for a later date.
damn your right, i do believe the velocities are world related, in which case you need to dot product the velocity with the direction normal.Originally Posted by BERTANDERNY
edit: i'll explain.
V=velocity vector
N=normal vector, use either UP/Direction/Side (what ever is correct)
S=speed
S=V.N
so
S=Vx*Nx+Vy*Ny+Vz*Nz
this is made more compact if you have the DLC as it has dot product option in the vector-vector math trigger, other wise its 3x Two Input Operator with 1x N-input set to add.
whoa lol, gona have to read that a million times. this may be beyond me tbh. hopefully when im finished it will be worth the work. thanks for your help tho man.
i knocked a quick google doc visual aid, hope it helps.
Speed DotProduct: Velocity . Object Normal
oh wow cool. thanks man. dont get how that works but ill see how it behaves tomorrow. as i said i dont need this right now as i have done something slightly different but if this works, i will deffo be using it in the future. if/when i do you will get a mention. thanks again for your time dude. whether it works or not![]()