Questions tagged [rotation]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How to make a top down 2D ball rolling

I am developing a top down game similar to 8 pool billard with libgdx and box2d. How do i make a 2d ball texture look like its rolling when force is applied like this: So it feels actually 3d ? For ...
0
votes
1answer
39 views

how to move character move on a circular surface in only one direction?

Making a 2d game: I want to move a character circular surface in only one direction?? Programme: ...
0
votes
2answers
45 views

Objects aren't rotating in sync

This is a follow-up question to How to reapply force applied to one object to another object I want to make two objects move, react to collisions and other stuff as if they were one. For example, ...
0
votes
1answer
49 views

Unity 3D rotating object around 2 axes rotates it around 3

I am developing a 3D space shooter and I've fount that when triying to rotate the ship using X and Y axes it also rotates on the Z axe. The answer here helped me a lot, but now when I try to rotate ...
0
votes
0answers
15 views

Rotating cube as child of another gameObject results in it skewing in 2 of 3 axes [duplicate]

I have added a cube and changed its scale and position but not its rotation. I added a second cube as a child of that first cuboid. I was hoping to rotate it but instead it just skews the second ...
0
votes
1answer
45 views

How to Reset Position Of my player?

Link:https://academo.org/demos/rotation-about-point/ ...
0
votes
1answer
33 views

Clockwise / counter-clockwise convention for Vector2.Rotate(float angle)

I am making a 2D game in Unity, and from what I understand, their convention is that an angle of 0 is up and increasing the angle rotates the object counter-clockwise. Sidenote: I made this ...
1
vote
0answers
50 views

How to calculate the torque required to rotate rigid body about constant axis and rotating axis?

How to calculate the torque required to rotate rigid body about constant axis and rotating axis? Convention: Identity Rotation Matrix: ...
6
votes
1answer
489 views

Unity: transform.LookAt(target) not “looking at” target?

I have been troubleshooting a prefab for several hours and am out of ideas. It concerns a method that I thought I was comfortable with, transform.LookAt(target). I have this prefab: As you can see, ...
0
votes
1answer
26 views

How to construct this collision vector?

I have a 3d game, but for movement I use only two axes (X and Z) - X is vertical, Z is horizontal Here's what I'm trying to achieve: Player is the circle, InputDirection is Blue, NewInputDirection ...
0
votes
2answers
38 views

How to limit camera pitch (x rotation) between two angles

I use this script rotate the camera on its local X axis: float v = verticalSpeed * Input.GetAxis("Mouse Y"); transform.Rotate(-v, 0, 0); Right now this lets ...
0
votes
1answer
42 views

How can I move and rotate an object along with another using vector math?

How can I move and rotate an object along with another using vector math? This is using Godot 3.1 using a KinematicBody2D as a ship with a ...
1
vote
0answers
27 views

Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground (\$y=0\$). When a vertex hits the ground, I apply the (linear) impulse $$\overrightarrow{P}...
0
votes
2answers
63 views

How to convert Blender rotation angles to Unity rotation angles?

I add news cameras in my game. I have a problem with rotation, the result is not alway the same as in Blender. I tried lot of ideas but today I do not have anymore. Cameras 1, 2, 4 : good rotation ...
0
votes
1answer
42 views

Unity: 'Quaternion.RotateTowards' animation is too fast (instantaneous)

I have a 'block-on-a-hinge' scenario where I just want it to smoothly rotate into the position of a stair step. I messed with this for a day and finally verified that my start and end angles are ...
0
votes
0answers
23 views

Why is not the projectile going toward the target?

I have a project where I can shoot (with a simple projectile). Character Blueprint (generate projectile): However I would like to be able to make the projectile go towards a specific target. ...
0
votes
1answer
41 views

Unity3d: Find which gameObject is in front

I have two gameObjects A and B. They are rotated at <...
0
votes
1answer
30 views

How can I use a coroutine and GetAxis to rotate a game object?

For the sake of learning about coroutine, I want to convert the following to a cleaner Update that just calls a coroutine. How would I do that? ...
0
votes
1answer
43 views

Rotate coplanar 3D points to XY

I have a set of 3D points. All these points are on the same plane. I have the normal of the plane. Now I need to rotate them in such a way that the Z value of all these points become zero. (that is, ...
0
votes
1answer
43 views

Rotate mesh to normal

I have some instanced geometry (basic tube meshes) laid out in a grid, and I have a noise texture (normal map) that I want to use to rotate my instances with. So head pixel in my texture is a normal ...
0
votes
0answers
13 views

Performing translation after rotation on object

I'm working in Maya and I have a light object. When I rotate my light object on the origin my manipulator rotates with object. However, as soon as I translate the light object (no longer at origin), ...
0
votes
1answer
50 views

Quaternion.RotateTowards not working as expected when parent object moves/rotates

I have a Tank with a rigidbody. A Turret Base is attached to the Tank via a Hinge Joint. The below TurretController script is attached to the Turret Base in order ...
0
votes
1answer
71 views

Quaternion rotation is inverse of what I expect

I'm trying to learn quaternions and decided to implement my own quaternion class. To test it I made a couple vertex shaders, one that gets a model matrix (calculated from the quaternion) and another ...
0
votes
1answer
105 views

Two Points Rotating Around Circle?

Currently I am working on a 2D game just like duet game, it is my first game (Unity 2D). When I press left key both points rotate fine. But when I press right, the points are not rotated. So my ...
0
votes
1answer
55 views

Strange problem with rotation missile | unity3d - c#

I have a vertical missile with launcher that should find closest target and fire it's rocket to hitting target! I use complete code of this 12min tutorial for launching my rocket, and the different ...
0
votes
1answer
45 views

if rotation < -45 && > -140 issue

I have a problem with this if statement. If the rotation is < -45. And > -140 Then this statement would be true when the rotation is = -90? And it would be false if the rotation is = -170? I'm ...
0
votes
1answer
43 views

Mouse drag rotation script doesn't work when attached to OBJ model

I am new to Unity. I imported an OBJ model and assigned materials to it. I want to rotate it using the mouse in the game, using this script: ...
1
vote
3answers
103 views

How to make TEXT RENDER stand facing the camera of my character and also for the camera of simulation?

I have an actor (Minion) with a Text Render just above it mesh: As you have seen, I defined your rotation as absolute, so the text does not rotate along with the actor. In the game the rotation ...
1
vote
1answer
127 views

how to clamp the look at function?

how can i look at a target on 2 axis but clamp the the object's rotation ,to only rotate from -45 to 45 on x and from -60 to 60 on y axis. i used this script to look at target and clamp the rotation, ...
0
votes
0answers
16 views

How to implement Meshlab's rotation manipulator? [duplicate]

I want to implement a rotation handle/manipulator mechanism that would enable user to rotate a 3D model exactly like Meshlab does. Unfortunately I don't fully understand how does the rotation gizmo ...
0
votes
1answer
37 views

Quaternion rotation around center, undefined behavior

Here's my code: ...
0
votes
0answers
36 views

The X axis becomes the Y axis after a quaternion rotation

I am making a FPS game, and I have a for loop where I place out "ground" objects. (pseudo code) ...
0
votes
1answer
44 views

Rigidbody character rotation

How could I rotate my character that I'm using a rigidbody to move. I tried using transform.eulerAngles and changing those but the camera feels very jittery.
0
votes
0answers
14 views

Rotation Freakout using Constraiend Rigidbody and VRTK_FixedJointGrabAttach

YouTube Video Demonstrating Error Constraining the ridigbody along certain axes. Used with VRTK: FixedJointGrab. Tried both precision grab and normal. Only freaks out when 1-2 rotation axes are ...
0
votes
1answer
58 views

Applying Y offset to rotation / position script

I'm using the script stated below to move a spray bottle around a head. The code works fine: I have assigned the script to the spray bottle, and I have set the head as the target. However, I was ...
0
votes
1answer
35 views

Adding -90 degree Y rotation into script

I'm using the following script to move a spray bottle around a head. It should looke like in a barber shop. The code works fine: I have assigned the script to the spray bottle, and I have set the ...
0
votes
0answers
64 views

Quaternion Rotation after performing previous rotations

Have Quaternion \$ Q\$ which is rotated on the \$X\$ axis 90 degrees. \$Q\$ is now \$ (0.707106, 0.707106, 0, 0)\$. I want to rotate \$Q\$ another ...
0
votes
1answer
27 views

Does CharacterController benefit from adding lerp?

Does CharacterController benefit from adding lerp? as in this script. ...
0
votes
0answers
15 views

Unity MainCamera won't rotate

I'm making a player-script/FPS in unity where you walk around with WASD and rotate the camera with mouse x/y axis. The "character"/"Player" should be able to rotate with the mouse X axis. (E.g If you ...
2
votes
1answer
38 views

How do I calculate vehicle rotation when two car wheels are on the ground to simulate gravity?

I'm writing some code to simulate a vehicle (tank or car) driving over a heightmap terrain. I'm not using a full physics engine, and just simply checking the height of the terrain at the 4 bottom ...
0
votes
0answers
9 views

Issues with Flashlight Handle position with player rotation

I want the flashlight to look same while looking up and down as when looking straight. Normal Position for Hand and flashlight: Looking up and down, position is completely off: More images for ...
0
votes
0answers
23 views

Unity: How do I fix the players model rotation in a NetworkManager to spawn properly?

How do I fix the players model rotation in a NetworkManager to spawn properly? I created a game with the NetworkManager code. Player Model is a cone I made and imported. all works fine but when the ...
0
votes
2answers
42 views

How to detect whether a transform has rotated left or right

I have a game object in my scene, and I want to know how can I calculate whether this game object rotating to the right or to the left. For example : ...
0
votes
0answers
37 views

Joystick Orientation Wrong After Camera Rotation

I am using a virtual joystick to move & rotate the player and a touch swipe system for the camera rotation, The problem is that when I rotate the camera (Let's say I rotated the camera to 45 ...
0
votes
1answer
50 views

How to rotate two textures at once in Libgdx, while keeping their relative positions the same?

I am trying to develop a game with cards, where the user can swipe left or right to tilt the cards like this. The red & white cross should stay in the same position on the yellow card as they tilt ...
0
votes
1answer
42 views

Character rotation according to camera causes rapid flipping when game starts

When I load my scene, my character rotates +90 and -90 on the X axis very fast about 4 or 5 times, and then he stops at -90 on X axis (lays back down). When I move the character, the rotations are ...
0
votes
0answers
131 views

How to rotate after a rotation in Godot / GdScript?

This 3D mesh is rotated by 45 degrees on the Y-axis. The camera follows the same rotation, resulting in these images Now I want to make the mesh rotating parallel to the camera. That is, if the ...
0
votes
1answer
34 views

Rotating objects in an random rotation around center point

I almost have what I'm looking for. Still trying to understand rotation and spawning of objects. I have a ground field with a number of spawn points (and they are placed randomly in a circle). It's ...
0
votes
2answers
45 views

Rotating on a slanted surface?

I want to rotate (change it's yaw) an object when its sitting on slanted ground. Pretty much I want to rotate around the ground's normal. Right now I ray cast down, get the ground's normal. Then I do:...
1
vote
3answers
143 views

How to accurately capture the direction in which the mouse moves?

I used to play this game on Kongregate called Death vs Monstars. A tl;dp (too long; didn't play) explanation of the mechanics is that the character you control follows your mouse cursor. Your ...