Jump to content
logan83

Cant setdir to attached Object ???

Recommended Posts

y try to do this and dont work...

Soldier attachto [Table, [0,0,0]];

soldier setdir 180;

the soldier is attached to the table... but i can rotate the soldier :|

Ok forget... the soldier is named as local variable... sorry...

Edited by Logan83
SOLVED!!!

Share this post


Link to post
Share on other sites

Hello, I also have this issue, how did you solve it?

I'm trying to attach a notepad (called "notepad") to a desk (called desk1) and rotate it 90 degrees. I feel like I've tried every solution suggested in them concerning "setDir" and "setVectorDirAndUp".

For instnace (used in the notepad's init line):

notepad attachto [desk1,[0,0,0.4]]; 
notepad setdir 90; 
notepad setpos getpos notepad;

(this one leaves the notepad on the ground, rotation still unchanged, even if I change it to "setDir 110" for instance)

And as the examples suggests on BIKI:

notepad attachto [desk1,[0,0,0.4]]; 
notepad setVectorDirAndUp [[0.5,-0.5,0],[0.5,0.5,0]];

(nothing happens by adding the setVectorDirAndUp line, no matter the numbers)

//Noddan

Share this post


Link to post
Share on other sites

attachTo is broken. You can setDir an object that is attached to a unit, and vice versa, but not an object attached to another object.

Have you tried setting the direction first then attaching?

An attached object's direction always reverts to 0, relative to the "front" of the thing it is attached to.

Edited by 2nd Ranger

Share this post


Link to post
Share on other sites

Killzone Kid found a workaround in the feedback tracker, you have to execute the commands twice at the moment.

notepad attachto [desk1,[0,0,0.4]]; 
notepad setdir 90; 
notepad attachto [desk1,[0,0,0.4]]; 
notepad setdir 90;

and

for "_i" from 1 to 2 do {
notepad attachto [desk1,[0,0,0.4]]; 
notepad setVectorDirAndUp [[1,0,0],[0,0,1]];
};

both work!

Check out issue ID: 0007228

//Noddan

Share this post


Link to post
Share on other sites

Note that this doesn't fix the issue when on dedicated servers.

Share this post


Link to post
Share on other sites

Is using SetDir after Attaching to an object no longer working?

 

Nevermind.  Please ignore this post.  Using setdir after attachTo works as it should.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×