alignAxisToVect negative axis?

Is it possible to use a negative axis for alignAxisToVect? I tried using -1 for -Y and such, but it doesn’t like that.

The reason I’m wondering is because currently when I use the method for gravity simulation (in other thread), objects will appear to “snap” into the direction specified (I’m using Y) rather than just follow through with their orbit by using the negative axis. I have it all set up with scalar product to figure out which axis to use, the problem is just telling it to use it :confused:


Could you just multiply the vector you pass to it by -1 if the conditions are correct.

nope because the method only seems to accept positive numbers

axis: Game Object axis
Type: integer

     0 = Game Object x-axis

1 = Game Object y-axis
2 = Game Object z-axis

How about when your getting the vector:

vect = -(position1 - position2) # this would give you the vector pointing in the opposite direction
obj.alignAxisToVect(vect, 1)

A vector is not a number. You are not showing the right parameter in your post.

You revert a vector by multiplying it with -1 as kevincorrigan already mentions.

ah, didn’t think about mutliplying the actual vector by -1. sorry for looking over his post, and thanks for the correction!

or you can just use -vector its the same