Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
3k views

Converting a quaternion in a right to left handed coordinate system

I have a quaternion from an IMU that id like to represent in unity. The issue is that the sensor uses a right handed coordinate system while unity uses a left handed coordinate system. In order to ...
0
votes
2answers
573 views

How to make UI Button to rotate an gameobject?

I'm trying to make a button to make a gameobject rotate and stay rotating in its own axis (Y) but I cannot make it work... As far as I know it's very simple: Create an empty gameobject (or whatever ...
4
votes
2answers
518 views

How to randomly rotate a D20 Dice in Unity?

I'm working on a Dice Application in Unity that involves randomly rotating a dice model on instantiation and then dropping it. But in order for this application to be useful I need to guarantee that ...
2
votes
1answer
96 views

Why does this work? - camera rotation from screen space

I do not understand the math behind the linked function or why it works. I would like to know this. https://sidvind.com/wiki/Yaw,_pitch,_roll_camera ...
0
votes
1answer
46 views

Setting position and look direction of a GameObject

I'm making a bendable game object comprised of a number of bones. The bones positions are calculated using some joints and some maths and that is all working as expected. But I am struggling to rotate ...
2
votes
1answer
205 views

Impulse resolution for purely rotational collisions (relative linear velocity = 0)

I've been writing a basic physics engine, (loosely) following Randy Gaul's online tutorial. I have been using this equation that he derives: $$j=\frac{-(1+e)((V^A-V^B)*t)}{\frac{1}{{mass}^A}+\frac{1}{...
1
vote
1answer
115 views

Rotate player to a specific angle using Rigidbody2D

First of all, I'm an absolute beginner in unity and coding so please excuse my lack of knowledge and my mistakes. I didn't achieve to fix my issue with others posts. I'm trying to do a little top-...
1
vote
3answers
165 views

How to add rotation to two particle collisions?

I'm trying to make a particle system where when particles collide, they merge together, to get the new velocity vector the smaller particle's force is added to the larger one. However, this isn't ...
0
votes
1answer
95 views

Object is not rotating from right direction

im beginner to unity so im using this code to rotate object with mouse with max rotation of 35 degrees,it is working but it's only possible to rotate object if mouse is under of that object. here is ...
0
votes
2answers
951 views

LookAt only in Z axis

I'm fairly new to game development, like many of us asking questions here Currently, I'm trying my luck working on a simple space shooter. I'm trying to add some enemy ships with movement, they will ...
0
votes
0answers
37 views

Torque Generation

I have written a basic physics engine. It is able to handle rotations. But how do I handle case like this where an object sits on top of another and needs to rotate due to the effect of gravity ? I ...
1
vote
2answers
2k views

Unity, rb.MovePosition and transform.Rotate at the same time

I can't figure out why my object can't move and turn at the same time. ...
0
votes
1answer
117 views

Rigidbody has unintended effect, velocity limiter from unknown source

I have made a script that alters a rigidbody's angular velocity. It works well but has one issue, its speed plateaus past a certain point. Here is the script: ...
0
votes
1answer
371 views

Unity3d: Rotating a sphere so point lines up with the camera

I'm trying to make a world map in Unity that contains a rotating globe with landing sites on the perimeter. What I want is that when a player clicks on the landing site the globe rotates so that the ...
3
votes
1answer
142 views

Pitch becomes yaw as camera gets near object

I have been having trouble with my camera, first encountering the roll tilt that is so many times asked... I fixed that issue by following the instructions at this link: Unwanted roll when rotating ...
1
vote
1answer
1k views

How can I rotate models in their local space using OpenGL?

I have a base application where a model is loaded in, however I need to manipulate the models positions and rotations independently so that each model in the scene can have its own rotation and ...
1
vote
1answer
618 views

How to stop the RotateAround function to rotate after Keypress in Unity

I have a camera follow script and I am rotating the camera with Q and E key to right and left. The Camera is a child of a ...
0
votes
1answer
98 views

How to Change position + rotation of a parent while keeping X and Z Rotation

Sooo this question is a problem , a evolution by another solution of this problem here: How can I change the parents rotation so the childs rotation is looking at a specific direction Basically: We ...
1
vote
0answers
413 views

Rotating RigidBody2Ds in Godot

I am practising programming games with the Godot Engine and I've been having some issues with RigidBody2Ds. In this case I have a ...
3
votes
1answer
2k views

Unity Pixel Perfect Rotation

I'm making a pixel-art game in Unity. The sprites are set to 16 PPU, and currently to guarantee that the pixels scale nicely (integer intervals), I'm setting the Camera's orthographic size. In 16x9 ...
0
votes
1answer
632 views

How can I set only the players X rotation to 0 in Quaternion.Slerp in Unity?

I want to set the players X axis to zero while he is turning to the target Object but I dont get it to work. Code: public float rotationSpeed; ...
0
votes
1answer
23 views

C4d or 3DS-like matrix rotations

I have a rotation 4x4 matrix to generate a model matrix, but I would like to be able to control it like cinema4D or 3ds Max with three separate angles that are always perpendicular to each other, and ...
2
votes
1answer
84 views

How can I ungrab the grabbed Object in Unity?

I modified a grab Script to my purpose, I can grab the Object and make it a parent to the character with the Key "G" but I want to let it go and detach the parent of the picked Object with "H" with ...
1
vote
3answers
5k views

How do I rotate the Camera around the player by Keypress in Unity?

I want to rotate the camera around the player by pressing E and Q but it doesnt rotates around the player. I tried RotateAround but didnt worked. Code: ...
0
votes
1answer
33 views

How to get smoother transition between the surface normals rotation of player in Unity

I kinda have a problem that my player is snapping onto the other surface while I wanna move a ramp up. I want to have it rotate smooth to the normals of the ramp. How can I change the code below to a ...
0
votes
1answer
44 views

Calculate corner rotation to fit between 2 waypoints

I'm currently working on a system where I create a linear path by spawning waypoints, but i'm struggling to figure out how to compute the rotation needed to render the corner waypoints correctly. if ...
1
vote
0answers
423 views

How should the physics be on an halfpipe like in a skate game in Unity?

I am making a inline skating game. My player is skating based on the normals of the surface of the ground. But when I skate up a halfpipe it flies in the Air but doesnt comes down like it should be, ...
0
votes
1answer
130 views

How can I add up the Transform/GameObjects in the Array of Waypoints in Unity?

I come up with this code and I try to get the waypoint + 1 when I reach the waypoint and it adds up till the last waypoint. I get Array is out of Index error. I guess I need and foreach loop of ...
1
vote
1answer
86 views

How do I simplify this code with an Array and counting int up in Unity?

I want to simplify my code. I had the idea of making an Array of waypoints[] and and int i to count up each time I arrive a new point of waypoint but it should be the same way my code is but instead ...
4
votes
1answer
904 views

Why is my model rotating opposite direction around the Y axis?

I have a simple scenario. I have a simple scene, and in it I'm drawing a grid and a model, with some axis for orientation. I noticed when I rotate the model about it's local Y axis, if I rotate the ...
0
votes
2answers
965 views

What is the best way to code grinding for a skate game in Unity?

I am making a inline skate game, what could be the best method to code the grinding system, there are many various and complex stuff to use but what could be used to set it up simple and not that ...
1
vote
2answers
1k views

How to move a player along Waypoints with Rigidbody.MovePosition in Unity?

I have a player with a Rigidbody, I want it to follow along the Waypoints. I have used MoveTowards but it seems also not to work however. I want to use MovePosition to add force while grinding. I ...
0
votes
1answer
172 views

Unity, Player isnt following along the waypoints

I have a player with a Rigidbody, I want it to follow along the Waypoints, I have a script for it I tested it first on a Cube, everything worked fine, but on my character it just moves Towards the ...
0
votes
1answer
788 views

Unity Rigidbody stops directly after moving

I'm creating a skating game, my Idea now for moving was when I move and then dont press any button anymore to move, it should still roll a bit and decrease momentum after a short while to fully stop. ...
0
votes
1answer
777 views

360 Orbital Camera Controller

I have a stationary cube in my scene that I'm orbiting a camera around. I have my MainCamera nested under a GameObject that I'm calling 'OrbitalCamera'. I setup the script so that a click (or tap) ...
1
vote
3answers
1k views

How to make a 90 degree rotation happen over time

I'm trying to take a RotateAround function and make it happen over time. I've been tinkering with Quaternions to try and get it to work but I can't quite figure it out. This is the code: ...
0
votes
1answer
271 views

Calibration using quaternion

I have an external hardware which gives me quaternion values. Now I would like to calibrate the device at a certain position and show tilt variations from that position on the UI. For example, I have ...
0
votes
1answer
843 views

What is FRotationMatrix in Unreal engine 4?

I am working on FPS shooter example in Unreal engine 4 documentation. One of the lines for forward movement of pawn is ...
1
vote
1answer
165 views

Separating Axis Theorem and rotated objects

Quick question which hopefully won't require thralling through my code. I have a working implementation of SAT for 3D collision detection but I'm having some problems with dealing with rotated ...
4
votes
1answer
674 views

Unity - moving an object around a radius

I'm trying to move a 2D object around the mouse position, However, i want to constrain the object from rotating unnaturally around itself, i want it to basically rotate around a radius, similar to how ...
0
votes
0answers
27 views

Find centre of rotation from two locations

Ultimately I need to get c from the image and have a, b and that it takes 90 degrees to get <...
3
votes
1answer
113 views

Smoothly moving an orbiting object back into orbit

I have an object that orbits the player's sprite with code that looks like this: ...
0
votes
1answer
182 views

Rotation of a cylinder between to spheres in R3

I want to connect two spheres with the coordinates [ax, ay, az] and [bx, by, bz] with an cylinder which is placed in between the spheres an rotated. For the placement I calculate the center of the two ...
0
votes
1answer
53 views

Bullet direction incorrect around sphere

Here is a little background on how my game objects are set up, and how the rotations and firing bullets work. I am working on this game in Unity. I have two game objects that orbit a sphere (for ...
0
votes
1answer
91 views

Make object face another object on a sphere

I have a game I'm working on in Unity where there are two objects on a sphere at random locations (and random rotations). I want one of the objects to always rotate so that if it were to fire a bullet ...
0
votes
1answer
326 views

Create rotation in random direction from existing rotation

I am working on a game in Unity, and I currently have a game object (object A) located at the origin. I have a child of this game object (object B), that is 10 units back on the z-axis. When I rotate ...
0
votes
1answer
830 views

Moving camera in 3D - directX12

I begin to learn graphic programming on directx12. I try to make a camera wich can move dans rotate around the world. I take this code as a basis: https://www.braynzarsoft.net/viewtutorial/q16390-...
0
votes
1answer
190 views

Problem with FPS camera in Software Renderer

I am currently creating a software renderer (I know they aren't particularly useful anymore, it is purely from a knowledge and learning standpoint). I am using GLM and following OpenGL rules(as GLM is ...
0
votes
1answer
2k views

Unity Change Rotation of Animated Object at Runtime

So I made an animation, but sometimes i nedd to rotate the animation, but for some reason it isnt working. I can change the rotation of the object and then click play and it works perfectly like in ...
2
votes
1answer
2k views

Problem when trying to use rb.MoveRotation in Unity

OK so I learned that rb.MoveRotation is different from rb.transform.Rotate(). But I am having trouble using it and hoping you can help me. I usually use transform.translate(Vector3.forward) (after ...