localEulerAngles question
Noob question. So I have an object with y rotation at 0. I'm having it rotate so if I press A, the localEulerAngles.y changes to 15. And when I press D the rotation should change to -15 which is 345.....
View ArticleNoob: Question about standard c# mouselook script. And other probably noob...
I am a bit confused on mouselook in c# and unity. I used the standard asset mouselook script as a template and tried to change it to suit my needs. When i used it, it seemed to work perfectly, but my...
View ArticleWhat the localEulerAngles relative to if the parent is null ?
Hi there, I'm new in Unity. I had checked the Script Reference about the Transform.localEulerAngles, and it says "The rotation as Euler angles in degrees relative to the parent transform's rotation."...
View ArticleComplicated Rotation Issue
Hello everyone, This is my first post on the forums and probably will not be my last :). I have run into something of a roadblock in my code. What I'm trying to do is to get the player's upper body to...
View ArticleConvert Quaternion to Eulerangles
Hello, in my game I have to compare two y-rotation values of an object before and after an action. Little bit of my code: Function Update() var firstRotation = pivotPoint.transform.localEulerAngles.y;...
View Articleis there any way to get a sane number on an objects current y rotation?
Want to build a clock, rotate a plane, how can I see when the plane is rotated 0, 90, 180, 270 degrees etc? (I would like to read these rotation states then do other actions and so on) All I get is a...
View ArticleProblems rotating back to zero
Hi. I recently created a script that made the player lean with middle mouse click and drag. The problem that appears, is that the player does not rotate back to zero (on the Z axis). It rotates closer...
View ArticlelocalEulerAngles don't seem to work in an equasion
Hi, I'm having a weird issue. The idea is simple: rotate an object with Mathf.MoveTowards, and when the rotation is completed, do something. Here's what I wrote: void FixedUpdate () { //Set Speed int...
View ArticleProblem with localEulerAngles (180 degrees error?)
Hello, I just started learning Unity and I got a problem: I want to rotate a wheel around X axis (simulate movement) and around Y axis (simulate steering), using the following code:...
View Articlelocaleulerangles changes global angles?
Hi, In my scene I have a direction light. I want to be able to set the angle of the light to the ground. So I got: RotatingLight.transform.localEulerAngles = new Vector3(xValue, 0,0); Then I want it to...
View ArticleRaycast across angle?
Hi, I have a javascipt in progress here : var anglePartition : float = maxAngle/totalRays; var startDir : Vector3 = transform.localEulerAngles; for (var i:int=0;i
View ArticleMaintaining direction while jumping / rotating
Hello, I have three Vector3s: movementVector, jumpVector, fallVector. I want to be able to jump forward and rotate my object without its direction changing. I just want to make a 180 and still head in...
View ArticleHow to rotate an object on the z-axis using localeulerangles?
Okay so im trying to make my character rotate left and right through the Z-Axis. Here is the script I have written and what it does: (C#) public int LeanAnglePositive = 30; public int LeanAngleNegitive...
View ArticleLocalEulerAngles with random rotation doesn't work
Hi, I have a method in my script which is supposed to rotate by a random number when instantiating. The rotation script goes like this: newStructure.transform.localEulerAngles.y = (Random.Range...
View ArticleAddTorque stops working when model is vertical
I've created code for a rigidbody spaceship and it works perfectly unless the model angles vertically (X=270 or 90). When it hits that, the model still angles very slightly but snaps back into place...
View ArticleI want to rotate object away or towards camera around x-axis
Hi Unity people and consumers. Currently working on an controller that can grab stuff and manipulate it. I currently have gotten stuck due to a problem with my rotation function. I want it to be able...
View ArticleTranslate from JS to C# localEulerAngles
Hi i need help with some js code example i dont know how to use transform.localEulerAngles in C# properly.Basicly its a script for a character that turns the character to certain angles without turning...
View ArticleFixing the rotation around a particular axis using Quaternions?
I have a problem. I have a gameobject and I want to set its rotation around it's local Z axis (blue) to some value (lets say 0) whilst preserving it's rotation about its local X and Y axis (red and...
View ArticleSetting an objects angle about a local axis without localEulerAngles?
Hey guys (and gals), I'm looking to set my objects rotation around its local z axis to a specific value (in the below case 0). The problem is that I can't work out how to do it. I know people use...
View ArticleArm rotation question
Hey.. i did this script for move an arm up and down, but is not how I wanted to.. in this script, if i press Z or X the arm moves up and down continuously .. why? i would like that if i press Z the arm...
View Article
More Pages to Explore .....