Community Forum

trailerAttacherJoints

Forum Overview >> Farming Simulator 2011

CategoryFarming Simulator 2011
Created28.12.2010 17:22


Hel Zole (unknown) 28.12.2010 17:25
How to get queried the trailerAttacherJoints position?

I tried:
for k,v in pairs(self.attacherJoints) do
local x,y,z = getWorldTranslation(v.object);
renderText(0.5, 0.5, 0.03, string.format(x));
renderText(0.5, 0.4, 0.03, string.format(y));
renderText(0.5, 0.3, 0.03, string.format(z));
end;

Stefan Geiger - GIANTS Software 03.01.2011 10:23
There is no attribute called "object" in the attacher joints. The attribute you are looking for is called jointTransform.
This is the transform group you specified with the "index" attribute in the xml.


However with this code you will also get the non-trailer attacher joints.
There is an attribute "jointType" you can query to find out if it is a trailer joint.

if v.jointType == Vehicle.JOINTTYPE_TRAILER or v.jointType == Vehicle.JOINTTYPE_TRAILERLOW then
-- v is a trailer joint
end;


Note: Log in to post. Create a new account here.