Questions tagged [rotate]

The tag has no usage guidance.

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

Rotate and Zoom a group of tiles

I'm working on a tile-based game and I'm trying to rotate my tiles as a group around the center of the screen and want to have the ability to zoom in and out. Here my code: ...
Canox's user avatar
  • 103
0 votes
0 answers
29 views

I am looking for a flexible way to rotate a gameobject around another

I try to make an object rotate around another object on mouse input. In order to achieve this I used this code: ...
Paul Berta's user avatar
0 votes
1 answer
83 views

How do you make Cube not instantly rotate upon Keypress in opposite direction?

I have this movement script on a Rigidbody cube with X,Y,Z Rotation Constraints. It is working well to move and to rotate in the direction of the movement. However, ...
Max's user avatar
  • 11
-1 votes
1 answer
52 views

Rotating an object around a rotating object

Im trying to build a model for the solar system in OpenGl, and I got the planets to move around the sun, but can't get the satellites to move around their planet. I can't share my code since this an ...
Tudor Popica's user avatar
0 votes
1 answer
169 views

What is the difference between the two circles in the rotation tool in Unity?

What is the difference between the two circles in the rotation tool in Unity? In 2D rotation tool there are two circles which allow to rotate an object. And I can not conceive a difference between ...
some1 here's user avatar
0 votes
1 answer
474 views

OpenGL/C++ Rotate relative to shooting gun

I'm trying to make a 2D game where I have a gun that i use to shot things in the direction of the mouse resulting in an angle that I can get. I have some problems with the trajectory of the bullet ...
NeedHelpFast's user avatar
0 votes
1 answer
643 views

How do I calculate the x,y of the rectangle after rotating?

I'm using SDL2. I want to draw a textured rectangle and I'd like it rotated so I'm using SDL_RenderCopyEx. However SDL2 doesn't give me the option of repeating texture so I need to manually do it ...
Eric Stotch's user avatar
6 votes
3 answers
2k views

Rotation grid positions

I'm dealing with objects on 15x15 chunks in my game. I'd like the chunks to rotate, for example, rotation version 0 is the original position of 2,5; (EDIT: Oops, rotation 2 and 3 names need switching ...
Mushington's user avatar
2 votes
1 answer
176 views

Transform.Rotate is jumping around

Why is the parent that contains 4 children jumping around and then settling into a position instead of rotating once by 90 deg? I can't seem to get it to rotate a single time as expected. ...
mavish's user avatar
  • 151
1 vote
1 answer
47 views

Rotate Sprite in direction it is moving while beeing dragged

I am working on a 2D topdown game where you have cars you can drag around. you can touch any given car and move it around. This kind of works but when I drag a curve the sprit of the car does not turn ...
KonMos's user avatar
  • 11
3 votes
3 answers
458 views

How do I rotate a sphere so that a position on it comes to a specific location?

Sorry for my english. I added a picture to explain what i want. I want rotate Big Sphere to make the black point locate in front of camera. (to the white point's position) not black point moving, ...
Hree's user avatar
  • 125
0 votes
1 answer
50 views

After rotated by Z-axis, X/Y axis still rotating just like z is 0

I'm making aerial vehicle controller, which can rotate 3 axis: X(Pitch), Y(Yaw), Z(Roll). Rotating x(pitch) and y(yaw) axis works fine, however after I rotated z(Roll) axis, x/y rotation gave me ...
modernator's user avatar
  • 1,213
-1 votes
1 answer
867 views

How to rotate a point around a pivot by changing the axis

I've been stuck on this forever now because I don't understand math in the slightest and when people talk about matrices they just give the table and don't explain how to actually go through each step....
fong monkey's user avatar
-1 votes
1 answer
90 views

how do i clamp my camera's rotation on X and Y?

i'm using a script to make my camera rotate smoothly toward the mouse cursor on the screen. and the only thing i need is to somehow clamp it's rotation on X and Y. here : ...
h00man13's user avatar
0 votes
1 answer
151 views

smooth look at only on x and y

i'm using the script down below to make my camera look at mouse x and y position, and it has a limitation for my camera rotation.the problem is the way my camera rotates is not smooth at all.is there ...
h00man13's user avatar
0 votes
1 answer
179 views

Lowering Unity launcher graphic quality settings reduces mouse x turn speed, does quality affect time?

Lowering Unity App quality settings reduces mouse x turn speed, how to fix this? I am not sure why this happens my only thought was time.timedelta is affected by the graphics quality setting in unity ...
TeachMeEverything's user avatar
0 votes
0 answers
66 views

Rotate a Vector by Quaternions

I'm trying how to work out how to Rotate a Vertex using Quaternions, using a scientific calculator, or on paper. Exam preparation. My lecturer has given us this; Quaternion = (-0.5, 0, -0.7071067, 0....
George_H's user avatar
0 votes
3 answers
6k views

Stopping the texture2D from stretching in RawImage

I am working with a RawImage texture which is fully stretched, filling up the entire scene. I am using some code to download images from website and then show them on the RawImage, the code is simple, ...
Randomizer420's user avatar
0 votes
1 answer
41 views

Rotate player to vector3 point?

I want my player object rotate to face vector3 point on terrain. ...
Omer's user avatar
  • 214
0 votes
1 answer
665 views

Rotating Weapon Towards mouse.position

OK guys i have tried lots of things and researched but cannot find a solution please someone give me hope.. So on my phone when i am playing i want to shoot with a screen button in the canvas that is ...
Todd Weiss's user avatar
0 votes
2 answers
865 views

How to rotate object just like in the scene?

Look at this image, I selected an object and pivot is set to local: When I rotated selected object in the scene by X axis, it rotates exactly I wanted. But if I rotate axis from inspector or script, ...
modernator's user avatar
  • 1,213
1 vote
0 answers
2k views

How to make an object which position is not on the world origin rotate around the world orgin in threejs?

I've loaded an object and set its position on vector(5,2,-5) by threejs. And I wanted it to rotate around the origin point in the world coodinate system. I found a method in class Object3D called '...
tedyage's user avatar
  • 23
0 votes
1 answer
119 views

How do you rotate RigidBody2D along a given access using velocity and not transform?

I am trying to rotate my player along the centre of the world in Unity3D. All the tutorials and references I have looked through till now have left me to this working code: ...
Sudeep Kandregula's user avatar
4 votes
2 answers
2k views

How can I rotate the camera around the player on the Y axis on this code in Unity?

I have a problem, I want my camera to rotate along the Y axis while he is looking at the player with an offset. I want to rotate with Q and E key to right and left around the player but on my Camera ...
Daniel's user avatar
  • 141
0 votes
2 answers
1k views

Rotate camera around point of view

I'm trying to rotate the camera around the view point of the camera. So when the user looks at a build the camera rotate around that building. But the camera does not need to have the building to ...
JimmyD's user avatar
  • 135
1 vote
0 answers
481 views

Limit rotation angles for Quaternion

I have a short snippet that's rotating the meshes of the wheels as I'm driving forward, but it's also rotating wheels to match the direction I'm turning, and I wish to turn this off completely. ...
Michael Kaesy's user avatar
0 votes
3 answers
1k views

Limit rotation to certain angles for transform.rotate

I'm working on a small project to learn Blender and Unity, and one issue I recently came across is that while I can have the turret of my tank rotate on the z-axis based on mouse movements, I can't ...
Michael Kaesy's user avatar
0 votes
1 answer
829 views

Unity Controller to Make Reticle Orbit based on the right stick input

d platformer arena like game. Right now I have it so a reticle moves around the player based on a controller's right stick's horizontal movement using the rotate around function and while it works ...
Green Bray Games LLC's user avatar
0 votes
1 answer
107 views

Player Controller not working with rotation?

I have created a player character controller. It rotates first time good but not after rotate to its original position before rotation. I am sharing code with you so any one can help me, How can I ...
hardwork's user avatar
  • 117
0 votes
2 answers
393 views

Move around object

I have problem with Unity - 2D objects. I want to rotate object around circle and on click translate it (with same angle) outside the circle to another and still rotate. Rotating is working with ...
Tom's user avatar
  • 1
1 vote
1 answer
1k views

why the camera won't rotate around my object?

im new to unity scripting, and now am building upon "Roll a Ball" example in unity training. I wanted to make the camera rotate around the ball in the scene in Y axis, when mouse is moved, and watched ...
MrChips's user avatar
  • 85
-1 votes
1 answer
486 views

[opengl]get world position after rotate object by pivot

I need to rotate an object around a pivot,so I use this theory: Translate the object to Pivot position Rotate the object Translate back the object from Pivot position everything works fine,I can ...
Zain's user avatar
  • 1
0 votes
1 answer
198 views

how to naturally rotate a ball according to its velocity on a surface, a wall

I develop a game on cocos2d-x cpp. There is a ball sprite in my game. I move the ball on a surface(wall) via touch events but it can't naturally rotate according to its velocity. if i use ballSprite->...
Murat Bozdemir's user avatar
4 votes
2 answers
4k views

How to properly rotate towards a local point (a local LookAt)?

I am having a nightmare trying to make a child object rotate towards a given point of its parent object, similar to what is possible at the world level when using LookAt. The problem is that most ...
MAnd's user avatar
  • 4,897
1 vote
0 answers
59 views

Can I "Pre-rotate" VBOs while loading them in LWJGL?

It is possible to flip VBOs horizontally and vertically by swapping around destination coordinates. Is it possible to rotate an image by any angle, such as 45 degrees, using different destination ...
Lucien's user avatar
  • 1,156
-1 votes
1 answer
106 views

Right-side weapon rotate to face the mouse target

I have a 3D game looking from top to bottom where I move the mouse to aim at targets. I have a simple box (the player) with a sphere on its middle-front (that is the pistol) and a cylinder on its ...
Etienne Leite Gomide's user avatar
-2 votes
1 answer
1k views

how to rotate a sphere around centre (x y z) [duplicate]

I have centre of sphere at x y z. now I want to rotate any point (a b c) on the sphere about centre. how can I do it in c++.
arjun's user avatar
  • 1
1 vote
2 answers
395 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
user3690770's user avatar
2 votes
2 answers
1k views

Making a cube slowly rotate 180 degress one time on a mouseclick

I am new to C# and new to Unity. I made a script that can turn a cube slowly one time after a mouse click but I feel like its probably wrong for using FixedUpdate. Is this OK or is there a better way? ...
Jacob Jones's user avatar
3 votes
2 answers
831 views

Accelerometer bike game rotation help

Hi I've been making a game for the last few months and not sure what to do. It's a 2d bike game and I want the rotation done with accelerometer, at the moment To test on computer I've set the ...
Sam's user avatar
  • 41
0 votes
1 answer
1k views

Rotating an image in Python

So I am making an "Asteroids" like game and I can principally get my sprites image to rotate but when I do, the image gets kinda torn apart. This is the method I am using for rotation. Any help would ...
SyntheticWeb's user avatar
5 votes
1 answer
2k views

Unity Android Orientation Bug in Auto Rotate

I am currently looking for a workaround, or fix, for a Unity bug. I want to be able to auto-rotate my game, while respecting the Android system settings. Currently, if you set your Unity Orientation ...
jgallant's user avatar
  • 8,394