Hunter567T Posted July 28, 2010 Share Posted July 28, 2010 Ok i need some help with attachElements Let's say i have two objects with coordinates at 1185.015625, 3690.5087890625, 6.9000000953674 and 1177.4794921875, 3687.2998046875, 40.140277862549 to attach them i have put: attachElements ( object1, object 2, 0, 0, 0 ) How can i Attach the two of them but have them stay at their coordinates? Link to comment
50p Posted July 28, 2010 Share Posted July 28, 2010 When you attach elements they are attached to one object with specific offset. If you offset it at 0,0,0 then it will be at the place of the element that you attach the element to. So, you need to offset it by the coords difference that these 2 elements are located to each other. You can solve it like so: local x,y,z = getElementPosition( object1 ); local xx,yy,zz = getElementPosition( object2 ); local offsetX, offsetY, offsetZ = x - xx, y - yy, z - zz; attachElements( object1, object2, offsetX, offsetY, offsetZ ); -- you may have to swap over object1 with object2 Link to comment
Hunter567T Posted July 28, 2010 Author Share Posted July 28, 2010 It is better than before but it still moves abit away from it's coordinates. Any more help on how to fix this? Here is a photo http://img837.imageshack.us/i/mtascreen ... 62204.png/ Link to comment
AeroXbird Posted July 28, 2010 Share Posted July 28, 2010 I suggest you try to lower the coordinates, and start fine-tuning the coordinates because some coordinates will be off when you attach them.(from my own experience) Link to comment
Hunter567T Posted July 28, 2010 Author Share Posted July 28, 2010 What do you mean by "lowering coordinates"? Link to comment
AeroXbird Posted July 28, 2010 Share Posted July 28, 2010 try playing with the coordinates by increasing and decreasing the values (first to see what happends/what way it goes when doing that) then when you know how to move it, try to get it in the correct place, and fine tune it to remove little ledges Link to comment
Hunter567T Posted July 28, 2010 Author Share Posted July 28, 2010 ah ok was messing around with them before to try and fix them. I guess I'll try a bit more. Thanks all Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now