Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

Angle object only in the X axis

I'm trying to code a turret to angle towards a target, where I have one part of the turret only rotating on the left/right, and I want to animate another part to only angle up/down. I've got the left/...
0
votes
1answer
30 views

Is it possible to work out rotate in degrees per second based on this rotate logic?

I have this code to rotate an object towards another at a given speed. ...
-1
votes
0answers
11 views

if key up smoothly revert to its original position [duplicate]

I am trying to make a rotation script were this hovercraft rotates to add realism to the game. It works but after it finishes rotating it quickly snaps back to its original position in 1 frame. How ...
0
votes
0answers
18 views

How to rotate a rigidbody with a Pid controller

I would like someone to describe me how to use a PID controller to rotate a rigidbody with AddTorque to a specific position. (like a spacecraft that rotates the Y axis of rotation towards Camera....
0
votes
1answer
18 views

Change item rotation axis in inventory item visualization

I'm learning unity and i'm trying now make an inventory, i made a simple interface, and now i'm trying to make a item visualization. I look for some codes from web and i found this one: ...
0
votes
1answer
69 views

Rotate Rigidbody to face away from camera with AddTorque

I have a camera that rotates around an object with "Look At" . I want the object to rotate to face the direction the camera is pointing (Camera.main.transform.forward) using AddTorque, but I can't ...
0
votes
0answers
34 views

How do I determine the forward/right direction when I have the “up” vector? - Unity

I am trying to fix a gameobject for e.g. a cube (which i am using as a sensor) on my character. I need the cube to rotate (with orientation control from the inspector - I have a public quaternion ...
0
votes
1answer
23 views

How to keep the object rotation while using RotateAround in Unity?

I've got an object that has a comet-like sprite rotating around it. I'm using this code in LateUpdate() to make it rotate and keep the comet's tail at the right ...
0
votes
1answer
18 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 ...
0
votes
0answers
75 views

Prevent sprite from rotating with camera

I am creating a small 2d game and looking for a way, to prevent certain sprites from rotating with the camera. I could not find any settings that would allow me to do so, so my next best guess would ...
0
votes
1answer
15 views

How to scale smaller values more

Hello it seems like it should be easy and i am missing something but i really couldn't find a solution as i am fairly new to programming. So basically i want to rotate a object faster when its closer ...
0
votes
0answers
20 views

Rotate 3D object along Perlin noise direction

I have a 3D object I'm moving with a noise function and I would like it to face the direction it is moving in, so far I broke down the problem into the 2D plane. I did this for the xy plane and the xz ...
0
votes
1answer
28 views

Handling rotation interpolation at 180 degrees

I currently have a scene where 3d a gents move throughout a grid, each time they move that can pick a random cardinal direction up,down,left or right. They then rotate to face that direction using <...
0
votes
1answer
48 views

Calculating unit wheeling

The user clicks a unit to select it for a move. Its going to move to wherever they click next. It's centre c is point cf They then click a point it is to move to. This is to be where the unit centre ...
0
votes
1answer
42 views

Controlling Unity 3D cube with remote gyroscope

This probably will go into conceptual things as well, but what I would like to do is take a Raspberry Pi (with a Sense Hat), transmit the gyro values to Unity, and effectively have a 1-1 realistic ...
1
vote
1answer
30 views

Scaling a rotated child with parent-child transforms

In unity, if you parent something to another object, then give the child some rotation, and scale the parent, the scale applies to some arbitrary axis to the child, here's some pictures to demonstrate:...
0
votes
0answers
13 views

Quaternion.Slerp only moves halfway

I want to rotate my object by either 90 degrees on the y axis when pressing right or -90 degrees on the y axis when pressing left. I want to do this smoothly so I'm using Quaternion.Slerp. But, on the ...
1
vote
1answer
61 views

Third Person Flying Camera

I am having issues creating a third-person camera for my Rogue Squadron (N64) like game. First I have posted my issue on the official Unity Answers site here. So far my ship is behaving as I want and ...
0
votes
0answers
22 views

Rotate 2D Object Towards Mouse & Stop After Full Revolution

Essentially what i'm trying to recreate is a dial with a min and max setting. The player clicks and drags the mouse around the dial to move its position but I would like for it to stop at a full ...
0
votes
0answers
23 views

Move gameObject in its facing direction

I have the following four gameObjects, they have, respectively, the rotations: -90, 0, 90, 180. I want them to move as denoted in the image below This is what I got so far: ...
0
votes
0answers
30 views

Camera follows the player, but rotates around the wrong point

I'm trying to make the camera follow the player wherever they go AND rotate when I click the right mouse button and drag the mouse. The camera follows the player and rotates but the rotation isn't ...
0
votes
0answers
15 views

How to rotate my gameObject using Joystick control?

So, I am still a beginner C# game dev. and I am making a 2d airplane game right now and I wanted to know how I can make this feature when the joystick is faced in a direction let us say I moved the ...
0
votes
0answers
24 views

Unity Particle System How to rotate particle effect?

My Particle System creates a "puff" of smoke. When I rotate the particle system it doesn't rotate the effect, just the way the particle is shot. What I want to do is when I shoot a wall have it "puff"...
0
votes
1answer
46 views

Sticky Conveyor Belt

I'm working on having a sticky conveyor belt, so that objects can also go around it. But my objects currently get stuck half way, as seen in the picture. This is the movement code of the conveyor ...
0
votes
1answer
65 views

How can I fix sprite vibrating randomly which is moving towards the mouse while using camera.position set to the sprite as the center?

So, when I use camera.position.x = player.x; camera.position.y = player.y; to set the center of camera to my sprite, the code doesn't work as intended to. It's ...
0
votes
0answers
32 views

Make 2d camera rotate around the player

I'm making a simple 2d javascript engine based on a scene graph (all game objects are containers whose children live inside their parent's coordinate space). My camera implementation works by setting ...
0
votes
0answers
14 views

Stickman Ragdoll keeps twisting

I am very new to game development but I do have some programming experience of a few years, but that isn't helping me. I am trying to create a simple ragdoll character( a stickman) by joining the ...
1
vote
1answer
241 views

What are spline input keys?

There isn't a really adequate explanation of these anywhere on the internet, so I thought I'd ask this question here. What are spline input keys in Unreal? How are they represented in Unreal? Also: ...
0
votes
0answers
101 views

How do I prevent camera jitter when rotating the player - Unreal?

This is a problem that seems to have no reasonable answer anywhere around, yet is a commonly needed aspect of developing game mechanics. Context I'm developing a traditional 3rd person character ...
0
votes
0answers
9 views

How to fix roll in FPS camera when looking sideways [duplicate]

I am trying to calculate the rotation for an FPS camera. My closest attempt was to create a some Euler angles(from input) and multiply that with the view matrix, this works, but only if I am looking ...
0
votes
2answers
139 views

Why are rotations in 2D game engines often counter-clockwise = positive systems?

I was looking over the API for a game engine a friend was developing in her spare time. She made the decision to make positive angles rotate in a clockwise direction. This immediately struck me as odd....
1
vote
2answers
77 views

Rotate object always at same speed on screen, no matter camera distance?

I am rotating a globe like XCOM's hologlobe, I rotate it using Quaternion.RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta). I found a good value for ...
1
vote
1answer
95 views

Rotate Sprite towards mouse cursor SDL

I have trouble to make my sprite(Arrow) to point at the position of my mouse cursor but i don't get the Right results. I've tried this: ...
0
votes
1answer
61 views

How can I match the delta rotations of two objects?

Here is the code I'm starting from: ...
0
votes
0answers
37 views

How do I make a Transform object follow it's parents rotation

So basically i have a transform object parented to a gun. I use this transform to determine the position my bullets are spawned in, and their rotation. The position part of it works fine, but the ...
0
votes
0answers
26 views

Tilt car to accomodate for larger Tire

I would like to rotate the car so that the front wheels are touching the ground without using physics. As you can see i want to rotate the car by angle a, but making sure that both tires are touching ...
1
vote
1answer
42 views

Rotate a 2D object slowly to the touch position in Unity

I am creating a circular Joystick like setup in Unity. Played a lot with it in different ways but I don't get the desired results. ...
0
votes
1answer
30 views

Trying to rotate a point around another point and it's not working

I am trying to make a function to rotate a point around another point. My maths are very rusty but i did some research and i just dont understand why my function is not working. ...
0
votes
0answers
36 views

Unity : Rotate object on touch looks weird

Touch and hold the screen then rotate object continue("Object is unity default cube") that's my operation, but when object is Rotate then it's look like weird. I ...
0
votes
0answers
25 views

Unexpected changes in Ai population

I've been trying to do my first evolution script. I want my population to learn to walk in 3d space. I am getting issues with the movements and the mutation. In my script, they evolve based on certain ...
0
votes
1answer
77 views

Rotate an object on itself, from one random Quaternion to another

I have a situation: I have a 3D object in the world. let's say a sphere. I have 2 random directionnal vector: vector A, and vectorB: My question is: How to I rotate over time my object, from A to B ? ...
0
votes
0answers
9 views

Rotate to face the bottom of a unit towards a planet [duplicate]

I would like to have tanks that move around on a planet (a sphere). Depending on where the unit is, I would like it to always have the bottom of it facing the center of the planet. To do this I've ...
1
vote
1answer
119 views

Upper & Lower angular limits on Y and Z axes

My Task: I'm trying to replicate this project. I'm using unity as my physics engine. Currently I'm still learning how to work with the different joints unity has to offer. The type of movement I'm ...
0
votes
0answers
24 views

Unwanted rotations with transform.RotateAround

I didn't tough i would have issues with this, but unfortunatly I did. I have a Character (which is more a pile of cube) with a body, a empty GameObject for each leg attached to the body with a join ...
0
votes
0answers
11 views

Object transform rotation around correct pivot, but wrong pivot after colliding

I'm messing around a bit trying to create a table football table. So this involves create rods with players on them. The rod should be free to rotate around the Z axis with the players moving around ...
0
votes
1answer
51 views

Rotating Sprite Around A Point Without Messing Its Drawing Point

I am trying to draw and rotate an arrow sprite based on a point,around a static circle body without messing its drawing starting point. Arrow should be directed to the same direction with user touch ...
0
votes
1answer
48 views

Rotating a parent rectangle to align child with target

My beautiful drawings will explain better than many words (or at least I hope): The structure: The black rectangle is a GameObject (my weapon sprite). A and ...
0
votes
1answer
54 views

OpenGL object load in reverse

I am trying to load a model and it is loading it in reverse. When I am trying to rotate it 180 degrees it changes the lightning as well. I am not sure what I need to do to change the position that eh ...
0
votes
1answer
133 views

Tilting a game object left/right/forward/back with gyroscope, regardless of player's heading

I'm working on a mobile game in Unity and using the gyroscope to rotate an object along the x and y axes. ...
0
votes
0answers
124 views

Unwanted angular velocity in unrelated axis (rigidbody simulation)

so real quick I'm simulating 3D rigidbody dynamics. This is what I have: ...

1
2 3 4 5
19