Is there a way to rotate an object towards another while limiting it to only eight directions to choose from without using Alterable Values? The example file in the MMF2 directory, as simple as it is, just looks like Greek to me.
Printable View
Is there a way to rotate an object towards another while limiting it to only eight directions to choose from without using Alterable Values? The example file in the MMF2 directory, as simple as it is, just looks like Greek to me.
You could use a calculation by diving the angles (of a circle) into eight sectors and say if angle of object is > 10 but < 20, or something like that, in theory that should work.
-Variant
That's a bit complicated, and it also has problems when rotating towards the nearest direction (like when it's 1 and it's rotating to 31, it'll turn counterclockwise until it gets to 31 as opposed to going the short distance clockwise). ><
It's the 360 degrees of the object your taking about right?
-Variant
It's just how the objects are in general. Without the ADO, it has problems going from 0 to 359 (or 0 to 31).
What exactly are you trying to acomplish?
-Variant
Well, I just said "forget it" and took the code in the example file and modified it to get it to work, even though I have no idea what it is and couldn't reproduce it on my own. I'm just trying to rotate an object towards another object with the ADO but retrict the object to only 8 directions. I just didn't want to use Alterable Values, like the example shows.
I think this is what you are trying to accomplish.
-Variant
Nope. That's way off. x.x
What are you applying this to?
-Variant
Just a normal Active Object.
Do ya have Gwerdy Chat? We could talk in there if you'd like. The example file that I was talking about is in the MMF2 directory, by the way. Comes with the installation. I ended up having to do it like the example shows, though I didn't want to. Clogging up the object with too many Alterable Values already.
Try spreading the alterable values to save memory.
-Variant