x


transform local euler angles

I am using transform local euler angles to reset the angle of an animated character when it hits the ground. It needs to be local as the character is a child of a rigidbody which follows the surface normal. The problem that I have is that it works sometimes and not others however it always recognizes the collision. I can not see any pattern to work out why. Here is my code:

function OnCollisionEnter(collision : Collision) {      
    var angle : Vector3;
    angle = Vector3(0,270,0);
    playerAni.transform.localEulerAngles = angle;
    print("collide");
}

Any ideas peeps, I am stumped... thanks :)

more ▼

asked Mar 10 '10 at 01:32 PM

fran pugh gravatar image

fran pugh
19 4 4 7

just sorted it.. :)

Mar 10 '10 at 01:39 PM fran pugh

perhaps you could post your own solution as an answer to this question? It might help others in future.

Mar 10 '10 at 01:53 PM duck ♦♦
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I have the same issue with localEulerAngles. Sometime the localEulerAngles works as aspect, sometime not, and the problem always occur when I publish as standalone project.

Tonight I discover the problem would occur if I didn't select any object in Hierachy tab, if I select anything (no necessarily select the rotate object) in Hierachy tab, the localEulerAngles work as desire.

I test on Unity 3.5. It seems it is a bug.

more ▼

answered Apr 04 '12 at 04:29 PM

flim gravatar image

flim
16 2 3 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2498
x1278
x286

asked: Mar 10 '10 at 01:32 PM

Seen: 3053 times

Last Updated: Apr 04 '12 at 04:29 PM