- Home /
This question was
closed May 26, 2017 at 01:31 AM by
palodequeso for the following reason:
Problem is outdated
Question by
palodequeso · May 25, 2017 at 02:57 PM ·
transformupdatechild
Trying to rotate child independently of parent...
I have a child object with these bits in the script...
Quaternion targetRotation = new Quaternion();
Quaternion currentRotation = new Quaternion();
void Start() {
currentRotation = this.transform.rotation;
targetRotation = this.transform.rotation;
}
void LateUpdate() {
targetRotation = this.transform.parent.rotation;
currentRotation = Quaternion.Lerp(currentRotation, targetRotation, rotationSpeed * Time.deltaTime);
this.transform.rotation = currentRotation;
}
As far as I know, the child should rotate at a different speed than the parent, and indeed, when I Debug.Log the current and target rotations each frame, I can see the current interpolate to the target slowly. However, when rendering, I don't see this.
I'm a bit befuddled.
Comment
Follow this Question
Related Questions
Child Transform 1 Answer
Particles don't follow the transform of the parent gameobject? 0 Answers
Transform position not changing. 2 Answers