Does any1 know a way to get the position of an object relative to the players’ Y axis (like tracking but in python).
is there maybe some math function to solve this? maybe somehow with sin and con?
I just need to know if the object is on the left or right or behind the player
so the value doesn’t have to be much more then boolean
Try this:
target.position[i] - own.position[i]
Where i is the index of what axis to use.
Hope this helps
Ex.
I forgot to mention, i want to know where it is, relative to the player’s LOCAL axis and not the world.
or maybe better to say relative to the player’s orientation.
for example what angle is the target relative to the player’s local Y axis (which is also the forward movement axis) so that he know where to turn and how much.
Like Track_To actuator but without using it.
This will track towards an object without using the TrackTo actuator.
vec = own.getVectTo(targetObject.position)
own.alignAxisToVect(vec[1], 1, 1)
own.alignAxisToVect([0,0,1], 2, 1)
Ex.
cool, thanks for the quick answer