armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Question

hi, may somebody know how to get z axis of "transform.Rotate(0, 0, 10);"

like varcur zAxis : float;

curzAxis = transform.Rotate(0, 0, 10);

Edited by arwe2793

Recommended Posts

• 0

i want to get my z ahis and divide one number of that.

like this

curspeed / zAxis; coz you see thre are 3 axis, y,x and z. and i need just z value. my player is rotating by z axis, and i need divide speed from degrees of that z axis, but cant realy find how.

transform.eulerAngles.z found this line, but i get eror something like Nan, infinity... or something

speed = Xspeed / transform.eulerAngles.z;

Edited by arwe2793

Share on other sites
• 0
Rigidbody2D.AddForce(force) assign attempt for 'blue plane v2' is not valid. Input force is { NaN, Infinity }.
biplane controller:Update() (at Assets/biplane controller.js:44)

:/

alovedLiftLevel = curSpeed / 2;
AngleCof = transform.position.z / 2;
CalculatedLiftForce = Mathf.Lerp(CalculatedLiftForce,alovedLiftLevel,Time.deltaTime * (curSpeed * LiftMultiplier));

rigidbody2D.AddForce(Vector2.up * (CalculatedLiftForce / AngleCof));   is 44 line

dont know is my logic is good. i tried make a plane, and as fast plane flee, the hihter wings lift is, wings lift is addforce.

1.calculate max aloved lift acording speed divided by 2

2. calculate angle of z axis

3. calculate final lift force

4. add force to a rigitbody, and calculate it with degrees

z axis need by lower lift when flying in certain degrees

Edited by arwe2793

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account. ×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.