The 2024 Developer Survey results are live! See the results

Questions tagged [rotation]

Rotation is the circular movement of an object around a specific axis.

1,190 questions
Filter by
Sorted by
Tagged with
15 views

Libgdx modelinstance rotates about some imaginary circle circumference. NOT its own center y axis! [duplicate]

So confused about how rotation works based on local y axis of modelinstance: This how I create the modelinstance: ...
17 views

Rotate modelinstance node about its own centerpoint y axis in LiBGDX

I am trying to rotate the node of a modelinstance as follows: Note: the node and modelinstance are rotating BUT not about their own center Y axis! ...
30 views

Trouble getting the right Interp Speed with 'FInterp To' node

I was following this course using UE5 version 5.4.2 and building a "Handle Rotation" graph for a door that looks like this: I encountered this problem: setting the ...
37 views

Help with player strafing rotation

Problem: Player strafes in all directions fine but when rotated 180 degrees the opposite direction he can barely move in any direction. ...
788 views

How to rotate a child game object everytime when parent rotates? [closed]

I have a GameObject called Gun, and a GameObject called Hand which is a child of other GameObject named Player. When I pick up the gun, it becomes a child of the hand. The problem is, when the player ...
1 vote
82 views

How to rotate a 3d grid?

I have a spatial hashing grid that's mapped out like ...
543 views

how to have player stay on a rotating platform?

Im making a top down game in unity. in my game there is a platform where the player can stand on. while this platform is moving the player moves with it. here is an example: This almost works like i ...
30k views

Rotating an object with quaternion

I have a question in regards to using quaternions for the rotation of my graphics object. I have a Transform class which has the following constructor with default ...
59 views

Moving prefab body parts up and down — stops working when tied to a button click

I'm newbie to Unity and attempting to move a prefab's arm up and down on a button click but having some difficulty. The arm movement works when called from the Update() method without checking for a ...
110 views

Adding 1 million torque to a normal cube won't make it rotate extremely fast?

In Unity, I have a normal cube with a rigidbody component. I'm listening to keyboard input and calling AddTorque with extremely high values when a key is pressed. ...
5k views

Rotate from Current Rotation to Another using Angular Velocity

I am attempting to calculate an angular velocity that will get me from the current gameObject.transform.rotation to a given Quaternion rotation using angular velocity. I've tried several methods but ...
1 vote
19 views

2 object snapping using bounding boxes in Unity Runtime

I am using boundary boxes for all calculations. In the image below you may see a case where this objects need to be snapped. Currently the calculations go as following, the rotation is changed by the ...
504 views

How to rotate 2D arm around shoulder so gun points at cursor?

I'm trying to program 2D mouse aim, where the arms and the gun in the arms rotates to point at the mouse. But for some reason, the arms and gun rotate and do not follow the mouse position. The each of ...
88 views

Comparison of 2 different quaternion axes

I am trying to compare the Z-axis and the X-axis of two different quaternions in a way that would give me the Euler angles about the X and Y axes to line up the two different axes. In my program, the ...
37 views

Weird behaviors with transform.LookRotation when looking at position+Vector3

I'm working on a character controller for an isometric retro shooter. However, when making the character rotate towards where they are moving, I encountered some issues. The character doesn't fully ...
1 vote
41 views

Quaternion.Euler acting weird

so I'm building up a simple arcade racing game and I was messing around with the Wheel Colliders setup. I was wondering if it was possible to add some camber adjustments in real time depending on the ...
1 vote
24 views

Pan orthographic non-axis-aligned camera

I'm trying to create a panning control for a camera in bevy, but I can't seem to get the panning logic right when the camera is rotated. It works fine if the camera transform is directly facing the XY ...
177 views

Unity Navball x,y,z rotation axis' are not tracking main object

I am trying to figure out how to solve this issue. My navball is tracking the ship's rotation incorrectly as shown in the image. When the ship rolls (Z Axis) to the right, the navball rotates down on ...
808 views

How to keep track of camera's rotation while it's being rotated?

I'm building a 2D game where the sole interaction of the player is rotating what they can see (this is currently the camera, though it could be the world) by plus or minus 60 degrees. My current ...
1 vote
58 views

How to calculate a direction vector from a 3x3 rotation matrix?

I have a dataset containing 2D images of telco towers and metadata. Each 2D image has 3x3 rotation matrix which provides orientation info about the drone when it captured the image. Now I have a 3D ...
900 views

Limit rotation angle

I am currently trying to rotate the weapons of a spaceship towards the mouse position, but in order to avoid the collision of projectiles with the ship I want to limit the angle the weapon can turn. ...
57 views

Camera rotation in TouchDesigner

I need help on something I'm struggling with very much. I am working on a TouchDesigner patch where I have a Camera COMP with rotation on x, y and z axes. I need the formulas to convert such rotations ...
800 views

1 vote
256 views

In Godot, how do I reposition the center of my mesh?

When importing a Unity package to Godot via Unidot importer, I noticed that a few imported models have their child rotations and transformations off-center from their expected points. For example, ...
227 views

invert:condition "det==0" is true error with no obvious cause

For my project I am turning my CharacterBody3D 90 degrees on the x-axis towards a wall. To achieve this I set basis.Z to the <...
35 views

How do you rotate a BoneAttachment3D during an animation?

I have a case where I want to rotate a bone that is otherwise controlled by an animation. The bone is the head bone of a humanoid skeleton. I have attached a ...
209 views

Why are Quaternions better than Euler-Angles for Godot (when to use which)?

Sorry about the click-bait, I know there are many many reasons why Quaternions and Bases are better than using Euler-Angles. Anyone on a 5 second google search could easily know why! But I am trying ...
58k views

How can I orbit a camera about it's target point?

I'm drawing a scene where the camera freely moves about the universe. The camera class keeps track of the view (or look at) point, the position of the camera, and the up vector. These vectors/points ...
436 views

Two methods of finding angle between vectors give different answers!

Ok, am I misunderstanding how Unity quaternions work, or is there a bad (about 2 degrees difference!) floating point error? The TLDR is I use a quaternion r to rotate vector v and put the result in w. ...
76 views

Turret following the player in the opposite side

i have tried using lookout method then flipping it by 180 degress but it gives me the same result as the problem i had before. my turret turns left when i move right and vica verse. To fix this i used ...
602 views

How to rotate a 3D object based on stick Input and the normal of the ground's surface?

I am making a game where I want to view an object from any angle and use an analog stick to rotate it according to this input and the surface the object is currently resting on. Here's a visualization ...
68 views

Motion Retargeting from a BVH File to a Rigged Mesh in Unity with Arbitrary Rest Pose

I want to perform motion retargeting from a .bvh file (from lafan2 dataset) to a rigged mesh in Unity (which is John Lemon in this tutorial resource). I have overcome most of the problems, but this ...
75 views

How to rotate spaceship quaternion to face target direction with constant angular speed?

I have an enemy spaceship, and I want to make it turn to face the player with (for now) a constant angular speed. The ship's orientation is a quaternion. How do I do this? Since this is totally free ...
76 views

How to get difference in rotation between 2 objects, but only on one axis

Say I have 2 cubes that start with the same rotation. I wish to track the rotation difference between the 2 about the z (forward) axis. Such that if cube A remains stationary and cube B rotates 30 ...
37 views

Usage of 'World rotation quaternion'?

While debugging the code that decomposes the world matrix, I found that the decomposed world rotation value is different from the world rotation value stored in Transform. Simply, World Rotation is ...
367 views

In 2D, how can I improve character rotation using raycasts when dealing with sharp/convex edges?

Edit: After making some edits to my polygon collider (based on @Alex F's suggestion), I can indeed confirm that sharp, convex corners are causing the buggy ...
878 views

Stop an object from rotating past a certain rotation value in Unity

Learning how to program in Unity, so bare with me. I'm making a game called Flappy Bird and I'm having issues with my z-rotation boundaries. Let's say I have some gameObject (call it Bird) that goes ...
1 vote
1k views

How can I find the offset rotation and position between two objects in 3D?

I have two objects in 3 dimensions, one of them (Child) is attached to the other one (Parent) using the offset between them (XYZ ...
94 views

Calculate Up Vector of Object on Surface Given Points and Normals

Context I want to find the up vector an object would have if it were leaning on a surface, given a large amount of points on that surface and their associated surface normals (i.e., an equation that ...
704 views

XNA Rotate Vector2 around Origin

I have a Rectangle and a Vector2 position, my sprite is being drawn at this position. The rectangle is meant to be a collision system with the cursor, when I rotate my sprite around the origin and ...
49 views

Unity Camera snaps back to camera mouse look after lerping to a point and rotating normally. Once mouse look is re-enabled it overrides and snaps back

I am trying to get the camera to rotate towards a location and position. Which works at the moment, but once it is done and re enables the mouse look script or bool in the script the mouse look ...
1 vote
41 views

3D transform hierarchy rotation applied in wrong order

I'm following in the footsteps of this blog in implementing a transform hierarchy to my game engine scenes. I have a fairly similar implementation for a 3D transform: ...
425 views

Issue with rotating character's spine bone in the late update

I want to make my character's spine rotate to look up and down. It's animated, so I have to rotate in the LateUpdate, not Update. The only I need to do is just simply rotate the chest bone through the ...
2k views

Clockwise / counter-clockwise convention for Vector2.Rotate(float angle)

I am making a 2D game in Unity, and from what I understand, their convention is that an angle of 0 is up and increasing the angle rotates the object counter-clockwise. Sidenote: I made this ...
2k views

Quaternion Rotate / Un-Rotate Error

I'm trying to un-rotate a quaternion, aligning it with the axis, and then rotate it back to where it was originally. But with every iteration it seems to lose precision and just after 20 iterations ...
44 views

Rotation inside MeshInstance3D surface plane

I'm trying to make a representation of a plane that rotates around a hole in a MeshInstance3D. So far I've managed to make the circle's hole, but I can't make the ...
58 views

How to align to 2D ground surface directly underneath?

I'm out of ideas at this point. I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
1 vote
180 views

Calculate path segments size

I have a problem more closely described on a picture below. The idea is that I have my agent in point A and I want to get to the point B. The problem is, that agents rotation towards point B is alpha ...