Game Development Community

Problem with object rotation on creation

by Itay Hauptman · in Torque Game Engine · 07/31/2006 (12:26 am) · 1 replies

Hi,

I tried to create a simple item from script, with an explicit rotation: "0 0 1 154" (I used setTransform along with the location)

Problem is, when I create the object, the rotation is bad: "0 0 1 204.321" when viewed in the editor,
or "1 0 0 0" when I use getTransform (the editor still shows 204.321)

I tried messing around with mRadToDeg (and mDegToRad) but it didn't help.

Any suggestions?


(I tried, as an alternative, to create the item with the editor instead of script, but then I have to hide it, since it needs to appear only at a certain time, and I couldn't hide it--setHidden didn't work)

#1
07/31/2006 (11:09 am)
You tried calling mDegToRad on the last part of the function like this?
%obj.setTransform(%pos SPC "0 0 1" SPC mDegToRad(154) );
setTransform takes rotation values in radians, even though the world editor and .rotation property uses degrees. It's confusing, I know.