Quantcast
Channel: Questions in topic: "quaternion.slerp"
Browsing latest articles
Browse All 133 View Live
↧

Head rotation is working on editor but not android phone

Hello everyone, I have a humanoid character and I am using Slerp to make its head rotate toward a certain point. To override the animations that I am using I added this part in LateUpdate. Everything...

View Article


Quaternion Slerp/Lerp doesn't work

Hi, I want to create smooth rotation of flashlight movement in the wrist. Everything works fine now, but I cannot get smooth rotation from original angles to new angles by using slerp or lerp...

View Article


How to make character rotate in the direction of movement and direction of...

[Here][1] is an example of what I am trying to accomplish that I found when trying to find a solution I am attempting to make a third person character controller with 8 direction movement where the...

View Article

few question about quaternion slerp

hi everyone. i have a coroutine that looks like this private IEnumerator StartRotation( Quaternion curPos, Quaternion targetPos, float t ) { float counter = 0; while ( counter < t) { counter +=...

View Article

how to rotate a gameobject back and forth smoothly ,How to rotate a...

Hello. So I am have a gameobject that needs to rotate backwards smoothly wait for a few seconds and then rotate back to its original position again smoothly.Here is my code: using System.Collections;...

View Article


Help with Quaternion.Slerp movement?

Hey, I've been having some trouble with a quaterion.slerp code. I want the movement of my object to rotate based on the wasd key press. It works, for the most part. However, my object keeps rotating 90...

View Article

Quaternion.Slerp is not working as Quaternion.Euler has weird values

I just want a simple Rotation in the Y Axis with random values and have following code: private void Rotate() { rotation = Random.Range(-360.0f, 360.0f); print(rotation); Quaternion qRotation =...

View Article

Quaternion.slerps resets camera rotation to (0,0,0) when i go to play mode...

i am building a camera rotation script like in fps. Everything is setup and working except that camera rotation resets to zero at the start of game which i dont want. This is the camera rotation i...

View Article


Quaternion.Slerp issue

I'm trying to rotate my camera using Quaternion.Slerp. I'm getting the desired rotation angle, but it's snapping to the rotation. I declared a float called "elapsed" and attempted to increment it...

View Article


Quaternion.slerp messing with wrong axies

So I'm trying to write a script to rotate my sled between -10 and 10 degrees on the X axis when pressing the left and right arrow keys respectively. What currently happens is that the sled will flip...

View Article

Quaternion.Slerp() behaves weirdly when turning to look at moving object

So I've got some giant bugs that I'm trying to have chase the player around the scene. Quaternion.Slerp() has worked to rotate the bugs to look at the player while they're chasing him, for the most...

View Article

Rotation by Quaternion Slerp problems

Im still facing issues with Rotation by either quaternion.Slerp or lerp. I do something wrong, but i cannot see it. In this example, i just want to simply rotate the cover of a chest on the x axis by...

View Article

Rotating clockwise or counter clockwise using Quaternions and PID

Given the code below, the object would begin facing to the right, and if something changed **yawState** to either back or forward orientations you'd see it orient itself to face that direction. Now,...

View Article


Making Player Rotation Smoother

I need help making my player rotation smoother. Right now, whenever the camera is facing a different direction than the player is facing, if I press forward with the player controls, he snaps into the...

View Article

[SOLVED] How to LookRotation in only Y axis

Hi guys, I'm 4-5 days since started unity noob and I'm just making a game, the problem is that I want to program the **movement** for the camera what just look with smooth movement at the Player, and...

View Article


How to offset an object's rotation using Lerp.

I have 2 objects 'a' and 'b' I want object b to have the same rotation as a, but when I press or hold 'W' i want object b to have a small offset on the X-axis making it seem to tilt forward a bit when...

View Article

Clock script with custom time not working

I've been trying to create a script for the clock for which you can enter start and end times manually, but for some reason it doesn't seem to work. I'm very new at this so I understand the fact that...

View Article


Quaternion.Slerp Does Not Rotate Object

In Unity 2020, I have an object that I want the user to be able to drag and rotate in all three axes, then release the mouse button and have it "float" back to its original rotation. It cannot be moved...

View Article

Help with tower defense game using LookRotation

void LookAtEnemy() { GameObject[] enemies; enemies = GameObject.FindGameObjectsWithTag("Enemy"); float speed = 0.05f; foreach (GameObject enemy in enemies) { Vector3 enemyPos =...

View Article

How to avoid single direction rotation with Quaternions?

void Update() { newDir = new Vector3(joystickDirection.x, joystickDirection.y, 0); angle = Vector3.Angle(transform.forward, newDir); Quaternion rotation = Quaternion.Euler(-angle, 0, 0); rotation =...

View Article

Quaternion slerp loop exits before equality of quaternions

The loop involves 3 transforms: playerBody, playerHTP and playerVTP which is a child object of playerHTP. I want all 3 of them to have the same rotation which is the rotation that playerBody has. So I...

View Article


Slerp bugs and other issues with turning the player character relative to a...

I'm working on a 3D platformer which uses a third person camera system in which the the camera and player essentially orbit each other, similar to what's used in most 3D Mario and Zelda games (see this...

View Article


Smooth LookAt OnTriggerEnter for static enemies

Hi, I've got a very simple setup where enemies are continually rotating until the player enters their range, at which point they need to turn towards the player. I've tried numerous Quaternion...

View Article

I cant find the issue on my code (Quaternion.Slerp)

Here is my code: public class test : MonoBehaviour { [SerializeField] [Range(0f, 5f)] float rotationSpeed; public float z_Z = 0; public bool rotating = false; private void Rotate() { //rotZ +=...

View Article

Quaternion Slerp always rotates to 180

When I press W, A, S or D, it always rotates to 180. Please help me. public Transform tf; void FixedUpdate() { if (Input.GetKey(KeyCode.W)) { tf.position += new Vector3(0f , 2f * Time.deltaTime, 0f);...

View Article


I can't get my Quaternion rotation to work

The first line of my code below makes my object follow the rotation of the object it collides with. The part after that is supposed to make the object rotate 180 degrees (go in opposite direction of...

View Article

Rotate clockwise/counterclockwise using Quaternion.Slerp()

I am using Quaternion.Slerp() to rotate an object towards player's rotation on Y axis. But if the player's rotation goes too far it changes the direction to take the shortest path. I want to rotate the...

View Article

Follow rotation on Y axis ONLY clockwise/counterclockwise.

The code I'm using now follows target position and lerps to target rotation. But when it can't catch up, it changes direction since it becomes shorter way to the target. How can I follow rotation on Y...

View Article

while player is ideally positioned it does not rotate 90 degree slowly , I am...

void LateUpdate() { if (Startmoving) { transform.position = Vector3.MoveTowards(transform.position, targetPosition, movespeed * Time.deltaTime);//movement playeranimator.SetFloat("Velocity",...

View Article



Need enemy mesh to rotate smoothly while moving along terrain

First post, and I have been teaching myself over the last month, so bear with me. ---------- I have a great enemy patrol script made up, and constructed a low poly terrain to test it on angled and...

View Article
Browsing latest articles
Browse All 133 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>