prustage on 27/7/2008 at 21:24
OK create a Gear and add "Rotation Rate" property to it then set a YAW rotation rate of say 40. In-game it rotates beautifully provided the gear is either horizontally or vertically oriented.
But if you tilt the gear say though 45 degs and then watch it in game something weird happens. It starts off OK but with every revolution its plane of rotation changes slightly so it starts drifting back to rotating either vertically or horizontally.
If you put a selection of equally tilted gears side by side and set them all rotating at the same YAW rate then they all start synchronised but gradually get out of alignment with some drifting towards the horizontal and some towards the vertical.
Anybody any idea why this happens and more importantly how to stop it?
Flux on 27/7/2008 at 22:11
I tried tilting a clockshaft2 after changing its mesh to a gear and it works. Added another one small gear nearby, and they all rotate properly even after being tilted 45 degrees. And they both touch each other without any problems while they are spinning. It might related with the mesh's collision settings, clockshaft2 seemed to be a tamed one.:joke: So I always use it and then change its mesh. Don't ask me why, it works all the time. And I make sure to set its initial havok state to direct controlled.
However, I don't know what you mean by "gradually". I watched them spin for 2-3 minutes before I typed this and they were all rotating properly.
There is also a bFixedRotationDirection property there, don't know if it will be useful, that should be a left over from unreal engine.
prustage on 28/7/2008 at 01:24
Thanks for your reply. I did exactly what you suggested:
1. Created 3 instances of clockshaft2. Placed them in a line then tilted each one by 45 degs
2. Changed the mesh of each one to various gears (prong, large solid, paddle)
3. Set the initial havoc state to direct controlled
4. Set the rotation rate for each to Yaw=40
5. Built, saved etc then watched in-game
They started off revolving nicely. By 60 seconds the gradual shift to the horizontal was apparent. (to me at least since I am now used to seeing it). By 4 minutes though it was obvious since the four gears were rotating in a completely horizontal plane and their centres (previously in-line on a 45 deg axis) were now displaced away from each other.
I tried adding the bFixedRotationDirection property and setting it to True but this made no difference. I Frapped the image every 30 seconds to show you but havent found an easy way of incorporating the images into this post.
Its important to maintain a fixed point of view and wait the whole 4 minutes otherwise - since they are all moving in the same way - the problem isnt immediately obvious. To make the effect really apparent just set one of the gears to a negative rotation (yaw = -40) then the problem becomes apparent very quickly as that gear will drift towards the vertical rather than the horizontal.
Flux on 28/7/2008 at 09:14
You are right, after 5 minutes they go back to horizontal position.:confused:
However;
I checked the gears in clocktower1. They all use gears but without rotation property, but with scripts. I copy-pasted two smallsolidgear2, tilted them 45 degrees and they were spinning for 5 minutes without any problems. (Didn't check for more than 5 minutes though.)
These gears don't have rotation rate property, instead they use scripts to make the rotation. You can either copy-paste them or use the exact properties.
I see you're into moving objects, playing through clocktower1&2 again would help you since those missions have lots of moving objects. And some of the moving objects in those missions have been rotated already after being put. And all have scripts to handle the movement. These scripts can be found under mission/clocktower.
prustage on 28/7/2008 at 11:01
Thanks for bearing with me - I thought I was going mad!
I will have a close look at clocktower today and see if there is anything I can use.
Many thanks
prustage on 28/7/2008 at 13:20
Thanks Flux,
I took a gear from Clocktower (clocktower2 as it happens - I find it easier to find my way around), noted - as you say - that it did not use the Rotation Rate property but a script instead. Copied it, created three instances and tilted them all. They are rotating now in perfect synchronisation - problem solved!
It seems the problem is with the "Rotation Rate" property that doesnt seem to be stable when not either vertical or horizontal - I suspect a cumulative rounding error in calculating its position.
Many thanks!:thumb: