|
Post by Karvy on Dec 28, 2016 0:57:13 GMT
Hello there, I was wondering how I can make an object to aim smoothly to another object WITHOUT using Quaternion Interpolate function.. that is because this function makes the aiming speed slower when aiming near the target and faster when aiming far away
Thanks-
|
|
|
Post by WhyNot on Dec 28, 2016 5:29:41 GMT
Maybe you should add a value to x,y,z axis slowly like
axis.x += 0.1;
and repeat until you get the desired value.
|
|
|
Post by Karvy on Dec 28, 2016 12:42:57 GMT
I've tried that but, what if I need to turn axis.x to 0.25 to make the perfect precision? I would use lower value to axis.x but it would rotate very slowly..
|
|
|
Post by WhyNot on Dec 28, 2016 16:32:30 GMT
Ahhh, I don't know
|
|
|
Post by TinSoldier on Dec 28, 2016 21:33:07 GMT
you could apply the interpolate function manually and avoid the "closer to " issue all together.
The script documentation for the interpolate command is -
That is: result = dstmin + (dstmax-dstmin)*((input-srcmin)/(srcmax-srcmin)) see the documentation for what each of the values refer too.
PS note: you must use the proper syntax ( curly brackets & math signs) or the function may not work as expected.
result = formula result dstmin = output or result minimum desired dstmax = output or result maximum desired input = source value to work with srcmin = source minimum value expected from input srcmax = source maximum value expected from input
|
|