Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 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....
Zagro's user avatar
  • 1
0 votes
1 answer
24 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. ...
AleVerDes's user avatar
0 votes
0 answers
22 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 ...
Haseeb Ashraf's user avatar
1 vote
1 answer
47 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 ...
ZReeder's user avatar
  • 13
0 votes
2 answers
46 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 ...
A-Eye's user avatar
  • 3
0 votes
0 answers
34 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 ...
CheeseS's user avatar
0 votes
0 answers
149 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 ...
26.565's user avatar
  • 1
0 votes
2 answers
32 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/...
CyberFlow's user avatar
0 votes
1 answer
48 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 ...
Darius Van Vuuren's user avatar
0 votes
0 answers
25 views

Rotate the parent object so that the child object points to the cursor 2D [duplicate]

I have an arm that has a pivot point on it. I want to rotate the arm so that the barrel of the gun points to the cursor. How do I calculate the angle of rotation for the arm? I'm not very good at math ...
Haslin's user avatar
  • 1
0 votes
2 answers
48 views

How to keep an object that rotates around another at the same height when the radius changes?

In my game, I have one object that rotates around another using transform.RotateAround, and I need to change the radius of its orbit. The behavior now is that the ...
Oled Neduda's user avatar
1 vote
1 answer
77 views

Using both look_at and flip_h in Godot

I am trying to have a player running in a side scroller platformer with its arms independent from its body, so that the arms can follow the mouse (to aim). The issue is that when the character goes to ...
balthazar's user avatar
  • 113
2 votes
1 answer
83 views

Where is the illusion of a moving camera perspective coming from in this rotatable cube model?

Just for fun, I had been attempting to build a model cube in vanilla JS that can be moved and/or rotated. What I was going for was the simplest possible representation (so, no adjusting for ...
Quack E. Duck's user avatar
0 votes
1 answer
32 views

Rotating around 3D cube Camera Controller for Unity

I am Unity game developer with more than 2 years experience. I am working in a personal project, a mobile game for Android in Unity. I am trying to make a camera controller for a 3D Cube Game in Unity....
DamagedCyborg's user avatar
0 votes
1 answer
24 views

Inertia Tensor Relative to Center of Mass vs Inertia Tensor in Body Coordinates

If I have the inertia tensor relative to the center of mass, is that the same as the inertia tensor in body coordinates? If no, can you please explain the difference and how do I numerically calculate ...
Learning CG's user avatar
0 votes
1 answer
45 views

Smartphone tilt calculation when using gyroscope in Unity (smartphone moving problem)

I have been trying for several days now to set up the correct behavior of the gyroscope in Unity. I want to make it so that when the smartphone is tilted, the object tilts along the z-axis. I found ...
Operator's user avatar
0 votes
1 answer
59 views

When to use InverseTransformDirection in Unity

I want to know when to use InverseTransformDirection. Unity documentation says : "Transforms a direction from world space to local space". Honestly, it is not clear for me. I came across ...
Achie1's user avatar
  • 169
1 vote
1 answer
28 views

How to throw an object using a rotating arm controlled by the player?

Apologies in advance for my lack of knowledge, I am very new to 3D My goal is relatively simple. The player controls an arm and uses the mouse to rotate it around a point. They can hold the mouse ...
Toon's user avatar
  • 11
0 votes
1 answer
53 views

Choose rotation facing direction

I am rotating a gameobject in Unity so it always faces another gameobject. However I want to be able to decide which side is going to face the target. I want to be able to change the facing point to ...
theCodeHermit's user avatar
0 votes
2 answers
112 views

How to rotate a plane about its origin?

I am trying to figure out how to rotate a plane about its origin in 3D space. Here is the last iteration of the code I am working with; the plane does not move. ...
RandomNumberFun's user avatar
0 votes
1 answer
61 views

Why can't I edit the rotation property in prefab mode so that rotation changes apply to all instances?

I am learning using the Explore Unity Course. In the picture you can see I've instantiated many hats from the same prefab. I want to rotate the hat in prefab mode so that the change will apply to all ...
MoonMoonBird's user avatar
0 votes
0 answers
25 views

How to make Cardial Directions relative to the camera

Lets suppose tha my movement method my W goes towards north(just figuretvly) and my E goes towards east, If I rotate my camera to east I want my W to insted goes to north, goes towards east and my E ...
Jamelaumn's user avatar
0 votes
1 answer
36 views

Orient a player mid-air to their predicted landing orientation in Unity?

Ever played Skate 3? When dropping into a ramp, or if you're midair, your player's up direction aligns to the normal of the surface you're about to land on, while respecting the player's forward ...
LeytonMate's user avatar
0 votes
2 answers
104 views

3D First person Rotate Character Unity

I'm facing the problem that my chacter is spinning around itself when I try to move, that's because Im trying to make my player move in the direction of the camera, but when I move it keeps rotating ...
Jamelaumn's user avatar
0 votes
1 answer
73 views

How do I make my player rotate in the current direction of my camera in Unity using C#?

I have a player with third and first person camera, I want to make my player move in the direction that my camera is looking at when I hold the right mouse in third person and move(Like my player is ...
Jamelaumn's user avatar
1 vote
1 answer
66 views

How do you rotate an object that uses a quaternion to represent orientation in 3D from a 3 vector input with values from a gamepad?

I'm using unity3d to create a six-degree of freedom flying game. The game takes in input from a standard dual-stick gamepad (like the Logitech f310). In unity each of the gamepad's joystick's axes are ...
RhinoPak's user avatar
1 vote
1 answer
102 views

Orbit and control distance from object in 3D

I'm stumped on a key part of my game project, built in Godot 3.5.2. I'm trying to have my player character be able to rotate around an object using A and D, as well as get closer and farther from it ...
sungen's user avatar
  • 13
0 votes
1 answer
66 views

Rotating on Z axis with easing

I am stuck with rotating a GameObject on the Z axis with easing. I want to achieve an effect like in this game: Here, the ring of targets starts rotating periodically. It starts slower, than ...
Taras Fityo's user avatar
0 votes
1 answer
60 views

how to rotate my character along the y axis when character is aligned with a slope

I have a capulse character Im moving around in my 3d Game, I usually rotate the character using this line of code: ...
Jambo's user avatar
  • 11
0 votes
1 answer
480 views

How to clamp rotation on a specific axis?

I want to rotate an object based on mouse delta but I am unable to clamp it because I only want it to turn so far on a specific axis. ...
sad eggs and ham's user avatar
0 votes
1 answer
627 views

How to rotate a mesh in shader graph?

I want to rotate a mesh in a way that the Z axis arrow always points towards the camera. For a script I would do something like this: ...
Digvijaysinh Gohil's user avatar
0 votes
1 answer
103 views

How to rotate a player to orient their up with a landing normal?

I'm making a skateboarding prototype in Unity, and like in skate 3, I'd like the player to sort of "align" gradually to their predicted landing slope. I've written the code that gets the ...
LeytonMate's user avatar
0 votes
1 answer
103 views

Trying to rotate a 2D kinematic object along its Z axis when its Y rotation is exactly 180 degrees causes massive rotation swings

I have some code that allows an object to be rotated back and forth on its Z axis, but am having issues when the object has an initial Y rotation of exactly 180 degrees while also trying to rotate it ...
Ginger and Lavender's user avatar
0 votes
1 answer
75 views

glm::eulerAngles gives unexpected output for quaternion

I used the euler->mat4->quat to give the right result, but euler->quat gives the wrong result - is there something I did wrong? ...
Zero Skyline's user avatar
1 vote
1 answer
236 views

How to rotate 2D image in 3D space using a quaternion

I am trying to rotate a flat 2D image around a 2D origin in 3D space. The problem I am having is that the image becomes stretched after the rotation. I am using the WGSL from this tutorial, but with ...
CyberFlow's user avatar
0 votes
1 answer
236 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. ...
user1895149's user avatar
0 votes
1 answer
52 views

Rotation is happening in reverse when the cube is upside down

I am writing this functionality in DirectX to rotate cube using the mouse. Now the functionality is working perfectly fine when the cube is sitting straight, but mouse functionality is reversed when ...
technoid's user avatar
0 votes
1 answer
65 views

Align two meshes given 2 faces

I have two meshes (A and B) and I know that a triangle in A has the same size and same angles as a triangle in B. For simplicity, suppose A is an octahedron and B is a tetrahedron. And suppose the ...
nkint's user avatar
  • 941
1 vote
0 answers
24 views

I have a wind simulation in Unity, and i need to rotate an arrow to show the wind direction [duplicate]

I have this code that creates random vectors, which are used in the AddForce to push rigid bodies around. ...
Foneet's user avatar
  • 31
0 votes
0 answers
33 views

How to find position and rotation intervals for spawning objects in allowable alignments?

I'm trying to find intervals of positions and rotations to spawn the cup in front of the hand so that it is graspable (The cup is child of the hand). The problem is that I'm moving the mug in the ...
Gibser's user avatar
  • 1
0 votes
0 answers
164 views

Unity XR - Rotate a grabbed object with XRGrabInteractable around its pivot

I'm pretty new to VR development with Unity, what I need to do is to grab a clockwork object and rotate it around its pivot by moving the right hand controller, like if I had to do that in real life ...
Frank Eno's user avatar
  • 101
0 votes
1 answer
41 views

How do I align segments of rope to connect adjacent segments?

I have made a 2D rope in Godot using this thread here. The problem I am facing now is that the rope is not rotating towards player. I have tried look_At but it only ...
Nomi's user avatar
  • 33
0 votes
1 answer
182 views

Finding the center of rotation in 3d knowing the start/end transformations

I need your help to solve a trigonometry problem, I'm unable to find any documentation about on the web... For convenience, I will use "transform" to indicate a position+orientation. Let's ...
lightimpact90's user avatar
1 vote
3 answers
229 views

How do I move an object along its local axis?

I am new to computer graphics and am trying to make a simple little game where I can move a cube around with the keyboard. I have it so you can rotate the cube with the arrow keys, and I wanted to ...
Joe's user avatar
  • 13
1 vote
1 answer
446 views

Find look at rotation with offset

I've been trying to make a function similar to "Find look at rotation" but with an offset. Imagine I have a pivot and an object attached to that pivot with some location and rotation offset. ...
Luka Glisic's user avatar
0 votes
0 answers
168 views

Rigid Body is rolling/spinning on collision, is there a way to have it slide on surfaces instead?

I have a rigid body with a sphere as a collision mesh which can move and rotate freely. It realistically spins when colliding with other objects, but this is annoying from a gameplay standpoint. Is ...
Mazz1224's user avatar
0 votes
0 answers
82 views

6DoF camera control with a toggleable gimbal/horizon line lock and auto-upright button

I have a smooth 6DoF controller from following a tutorial (this is the tutorial) and tweaked it to be exactly what I want with a few exceptions. I found myself wanting the ability to lock the horizon ...
Mazz1224's user avatar
0 votes
0 answers
52 views

FPS controller capsule snaps back to zero when rotating

I'm trying to make a simple FPS controller, but when I try to rotate my Player Capsule it just snaps back to zero ...
user168461's user avatar
0 votes
0 answers
56 views

Different approaches to rigid-body movement

I'm a beginner at game development and I'm building my own physics game engine to grasp the concepts. I wonder if there are different approaches to moving and rotating a rigid body. For example, ...
mcas's user avatar
  • 1
1 vote
0 answers
184 views

How do I use Transform.RotateAround to gradually rotate my GameObject around a new pivot in the shortest direction?

Given a normalized Vector2 or eulerAngles.z, I'm trying to gradually rotate a 2D box around a new pivot (the top of the box) ...
Ginger and Lavender's user avatar

1
2 3 4 5
24