Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 192 characters in body
Source Link
user-44651
  • 187
  • 1
  • 9

I am rotating a gameobject that has a child game object with a particle effect on it.

It's a missile with engine exhaust.

enter image description here

I am rotating the parent game object but the particle effect child objects do not rotate:

enter image description here

The missile object has this script on it:

void FixedUpdate () {
Vector3 dir = targetObject.position - transform.position;
dir.Normalize();

float zAngle = Mathf.Atan2( dir.y, dir.x ) * Mathf.Rad2Deg - 90;
Quaternion desiredRotation = Quaternion.Euler( 0, 0, zAngle );

transform.rotation = Quaternion.RotateTowards( transform.rotation, desiredRotation, 10.0f * Time.deltaTime );
rigidBody.AddForce( transform.up * 10.0f, ForceMode2D.Force );
}

Particle Effect:

enter image description here enter image description here

Anyone see what I am doing wrong?

I am rotating a gameobject that has a child game object with a particle effect on it.

It's a missile with engine exhaust.

enter image description here

I am rotating the parent game object but the particle effect child objects do not rotate:

enter image description here

The missile object has this script on it:

void FixedUpdate () {
Vector3 dir = targetObject.position - transform.position;
dir.Normalize();

float zAngle = Mathf.Atan2( dir.y, dir.x ) * Mathf.Rad2Deg - 90;
Quaternion desiredRotation = Quaternion.Euler( 0, 0, zAngle );

transform.rotation = Quaternion.RotateTowards( transform.rotation, desiredRotation, 10.0f * Time.deltaTime );
rigidBody.AddForce( transform.up * 10.0f, ForceMode2D.Force );
}

Anyone see what I am doing wrong?

I am rotating a gameobject that has a child game object with a particle effect on it.

It's a missile with engine exhaust.

enter image description here

I am rotating the parent game object but the particle effect child objects do not rotate:

enter image description here

The missile object has this script on it:

void FixedUpdate () {
Vector3 dir = targetObject.position - transform.position;
dir.Normalize();

float zAngle = Mathf.Atan2( dir.y, dir.x ) * Mathf.Rad2Deg - 90;
Quaternion desiredRotation = Quaternion.Euler( 0, 0, zAngle );

transform.rotation = Quaternion.RotateTowards( transform.rotation, desiredRotation, 10.0f * Time.deltaTime );
rigidBody.AddForce( transform.up * 10.0f, ForceMode2D.Force );
}

Particle Effect:

enter image description here enter image description here

Anyone see what I am doing wrong?

Source Link
user-44651
  • 187
  • 1
  • 9

Rotating GameObject does not rotate child

I am rotating a gameobject that has a child game object with a particle effect on it.

It's a missile with engine exhaust.

enter image description here

I am rotating the parent game object but the particle effect child objects do not rotate:

enter image description here

The missile object has this script on it:

void FixedUpdate () {
Vector3 dir = targetObject.position - transform.position;
dir.Normalize();

float zAngle = Mathf.Atan2( dir.y, dir.x ) * Mathf.Rad2Deg - 90;
Quaternion desiredRotation = Quaternion.Euler( 0, 0, zAngle );

transform.rotation = Quaternion.RotateTowards( transform.rotation, desiredRotation, 10.0f * Time.deltaTime );
rigidBody.AddForce( transform.up * 10.0f, ForceMode2D.Force );
}

Anyone see what I am doing wrong?