Quantcast
Channel: Questions in topic: "localeulerangles"
Browsing index pages (106 articles)

(unity2020.3) weird behavior by transform.localEulerAngles (i want to get...

i found some solution (if its greater than 180, subtract 360 from it) but it did not work [check out this video](https://i.imgur.com/qJ6pbUc.mp4) first value is euler angle second value is local euler...

View Article


localEulerAngles command does not work well..

Hi to all, I try to control my object's rotation by using the localEulerAngles command. However, ıt did not work well. When the object rotates 0, 0, 90 angles in the x, y, z coordinate, command give me...

View Article


Rotating an object taking into account the main camera.

I currently have a script that depending on the joystick axis, rotates the object a certain way, I then send that rotation to the player and orient them on the direction this object is currently...

View Article

I tried to align a piston along an axis.

void SetRotation() { float currentRotationAngle = myTransform.eulerAngles.z; Vector3 axis = label2.transform.position - label1.transform.position; Vector3 piston = direction.transform.position -...

View Article

Help with creating rotational mapping

Hello all! First of all, I am sorry for my non-fluent English. In my project, I have to match the movement of body parts between platforms. Initially, i thought about matching their localEuler...

View Article


Multiple Coordinate Systems

Hello, I am rotating a UI object about the localEulerAngles Z axis. After I rotate it, I want it to translate vertically along the rotated X axis. However, it seems that when I use the following code,...

View Article

Local Euler Angles not Rotating GameObjects

Hello all! I am having trouble getting text to follow alongside my weapon for my VR game. I would just set it as a child of the gun, but this causes the text to lag behind the gun when the gun is...

View Article

Spaceship steering limit

I'm making a script to control the spaceship using Rigidbody and localEulerAngles. I made steering the spaceship by using mouse, now my question is how would I limit the rotation. For example : Right...

View Article


GetKeyDown works only once

Hi, I want to make my character rotate in the direction which he is facing(the game is top view), and I encountered this problem: Whenever I start the game, I start facing up, and I can press the arrow...

View Article


Optimizations: Should I use Update or FixedUpdate? Could you help me optimize...

Hello, I have a lot of MoveTowards and "rotation" type code for my bad guys that are spawned. They rotate (they are balls) and they also MoveTowards a location. How can I optimize this code to run more...

View Article

I am using Mathf.Atan2 to find angle in 2d and do not know how to apply...

Vector2 difference = anchorRotation- anchorRotationLastFrame; float angle = Mathf.Atan2(difference.y, difference .x); float angleInDegrees = angle * Mathf.Rad2Deg; Vector3 rotate = new Vector3(turn, 0,...

View Article

Setting a local rotation via script results in a 180 degree difference in...

I have a character and I'm **trying to set some of it's joint's local rotations** to certain values (clamping them, to be precise). The results were different from what I've been expecting, so I...

View Article

localEulerAngle quick question

transform.localEulerAngles = new Vector3 (0, 0, -whatever.transform.localEulerAngles [2]); Can anyone tell me what the [2] means in this situation? Thanks a lot

View Article


Unity Simulate Local Rotation

I've run into a situation where I need to be able to use a relative Y rotation for my player. This is so the player can walk on walls, floors, and ceilings and operate "the same way" regardless of...

View Article

localEulerAngles has trouble above 87.5 degrees

I've got a sun object that rotates around the world just fine, but when I try to make a time system that gauges the time by the sun's position in the sky, using transform.localEulerAngles.x (it rotates...

View Article


C# Mathf.PingPong Rotate Back and Forth

I've been trying to get my gameobject to rotate back and forth using Mathf.PingPong. It only goes from origin to rotFl. I need it to go from origin to rotFl then switch to from origin to -rotFl. Any...

View Article

Problem with using Rotate and localEulerAngles...

Why does this not work? object.localEulerAngles = new Vector3(0,changingValue, 0); object.Rotate(60*Time.deltaTime, 0, 0); //the result of this is "object" randomly alternates from turning and...

View Article


Why Local Rotation Faster than World Rotation (Degrees/Second)

I am working with a player control that handles player rotation and camera rotation all in the same Update function. I rotate the camera in local euler rotations and rotate the player in the world...

View Article

Bike stay upright based on surface normal

I'm having issues thinking of a good way to align my bike to the surface its riding on by modify the local z axis, without messing up the rigidbody simulation. I am able to get my bike to balance by...

View Article

Wheels Rotate or Turn, but not both

Hello! I have problem with my wheel rotation. It works if I just make them rotate or if I just make them turn, but not both at the same time! What am I doing wrong? public Transform wheelFLTrans;...

View Article
Browsing index pages (106 articles)


Latest Images