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
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! ...
• 121
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: ...
• 121
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. ...
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 ...
1 vote
83 views

### How to rotate a 3d grid?

I have a spatial hashing grid that's mapped out like ...
• 13
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. ...
• 133
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 ...
• 11
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 ...
• 23
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 ...
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 ...
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 ...
• 111
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 ...
• 103
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 ...
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 ...
1 vote
258 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 <...
• 23
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 ...
• 141
210 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 ...
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 ...
• 23
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 ...
• 111
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 ...
78 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 ...
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 ...
• 21
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: ...
• 111
50 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 ...
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 ...
59 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 ...
• 414
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 ...
• 13
34 views

### Sawblade's spin stops or jitters when swiping to steer it

I have a 3D object, a blade, that I want to rotate continuously on the x axis, like it's cutting through something. I also want the player to control its z-axis rotation by swiping. It's mainly ...
62 views

### Is this gimbal lock I'm hitting even with rotation matrices / quaternions?

I'm spawning a trigger box relative to another object using local offset. The engine I'm using does not provide a native function to make that conversion (at least in a way accessible to me), so I am ...
• 176
50 views

### Why do my trigger zones change rotation randomly on gameStart in editor?

I'm now doing a racer on rails like "Outrun". I do have a cool Script from internet that makes the camera and the player follow the Waypoints. The Waypoints are Trigger shapes. I have a ...
35 views

### Raycaster rotation problem

I am following lodevs tutorial on Raycasting https://lodev.org/cgtutor/raycasting.html. I was kinda successfull but for some reason while implementing a 2D Topdown view of the map and the player i ...
• 1
52 views

### Unity clamping local rotation on LookAt issues

I'm new to game development, and I've been trying to code a "smooth camera" rotation that's limited within the camera's local rotation, using a smoothed cube and ...
79 views

### Weapon flips upside down when aiming to the left

When the player turns to the left, the texture of the weapon turns upside down. How can I solve this? Shooting Script ...
1 vote
111 views

### How to set pivot point for rotating a sprite?

Is there a way to set the pivot point for rotating a sprite? The default option seems to be arbitrarily chosen point on the sprite or the mid point. ...
• 111
49 views

### Problem when changing matrix view in screen space reflexion

I’m using (DX11) LookAtLH or LookTo functions to get my view matrix. When setting Camera Direction so that the y component is zero I have the correct reflexion (picture left). When changing the Dir.y ...
• 139
70 views

### Aligning vector by rotation around non-orthogonal axis

This is almost more a geometry/mathematics question than a game dev one, but I think I'll have a better chance actually understanding the answer if I ask here. Rather than try to explain it- because ...
• 163
291 views

### Rotate Object Smoothly When Dragging

I want to make a 3d object rotate smoothly when being dragged in a ui in Unity. My stuff currently works but I just can’t get it to rotate smoothly, I can only make it rotate instantly which looks bad....
36 views

### Rotate UVs in shader and contains result into quad with repeat edge pixels

I ask for help - I need to rotate the UV scan inside the quad by a certain angle (set by a parameter) so that the result is embedded in the original UV, and the missing areas are repeat edge pixels. ...
30 views

### Follow camera is not turning when the followed object turns

I need a camera follow script to chase a moving ball. I've attached the script below to my camera, but when the ball turns left and right the camera does not turn ...
1 vote
140 views

### How to set world rotation directly in Stride?

I just started looking into Stride as a replacement for Unity, and I'm trying to rewrite some scripts. My question is: How do you set the world rotation of a transform component? In other words, what ...
• 13
1k views

### How to rotate NavMeshAgent toward its movement direction?

I'm working on a 2D game in XY plane. I've created enemies using NavMeshAgent and I've gave my agents way pints to move between them. The problem is that I don't know how to rotate them in the ...
171 views

### Correct order on accumulating rotations

Suppose I have an Arcball camera that rotates up/down and sideways based on mouse input. After doing some research, I discovered that the correct way of calculating the new orientation is to do it the ...
150 views

### Finding loss of angle and length due to rotation

I'm working on a targeting system for my 2d game. But I want to see the object in isometric perspective. My calculation is correct for 2d objects but it doesn't work for rotated in x axis objects. I ...
64 views

### Quarternion rotation flattening cube

I am trying to rotate a cube using a quaternion matrix with WGPU. However, whenever I try to rotate it, I end up with I am using the matrix from https://en.wikipedia.org/wiki/...
333 views

### How to make enemy turn to face the player while attacking?

I need help making this code work. It is made for the enemy AI to move and patrol, chase the player and attack the player. The problem is when it starts to attack the player, then the player can move ...