Page 1 of 1

setRotationAngles : no vector accepted ?

Posted: Mon Nov 17, 2014 4:40 pm
by Doridion
Hi all,

I'm trying to implement rotationAngles in the socket class ... but ... seems needing (x,y,z). I tried some tricks, but always crashing the editor.

rotationAngles = (1,1,1), -------------- NOK
rotationAngles = vec(1,1,1), ---------- NOK
rotationAngles = math.deg(1,1,1), --- NOK
rotationAngles = rot(1,1,1), ----------- NOK
rotationAngles = rad(1,1,1), ----------- Ah ... NOK ....

Antti, petri ? Some trick ? Thanks in advance ;)

Re: setRotationAngles : no vector accepted ?

Posted: Mon Nov 17, 2014 6:03 pm
by Prozail
ScriptReference is wrong...

try
rotation = vec(15,15,15),

Re: setRotationAngles : no vector accepted ?

Posted: Mon Nov 17, 2014 6:26 pm
by NutJob
Hey Doridion, open up the original campaign and take a look how the developers did this, plus a whole lot more. First thing I looked up, in the beach area, was how they got those three daggers to appear to be stuck into the tree trunk (just in front of the broken hull).

Re: setRotationAngles : no vector accepted ?

Posted: Mon Nov 17, 2014 6:33 pm
by Prozail
mm but setWorldRotationAnglesWithOrder is for GameObjects not components.

Re: setRotationAngles : no vector accepted ?

Posted: Mon Nov 17, 2014 6:39 pm
by Doridion
Prozail wrote:ScriptReference is wrong...

try rotation = vec(15,15,15),
Excellent, works fine ! Thanks Prozail ^^ Didn't thought to just use "rotation" as property ;)
NutJob wrote:Hey Doridion, open up the original campaign and take a look how the developers did this, plus a whole lot more. First thing I looked up, in the beach area, was how they got those three daggers to appear to be stuck into the tree trunk (just in front of the broken hull).
Thanks NutJob, already done and as Prozail answered, WorldRotation is for GameObjects scripting, here i'm defining my object ( hardcoding), and my problem was to add x,y,z vectors.

Thanks to both of you ;)