playMaker

Author Topic: How can I fix this strange rotation behavior? [VIDEO] - [SOLVED]  (Read 2219 times)

HeathClose

  • Full Member
  • ***
  • Posts: 226
How can I fix this strange rotation behavior? [VIDEO] - [SOLVED]
« on: February 01, 2017, 05:28:45 PM »
So I've already designed a back and forth mode of the game that is very similar to pineapple pen... and was trying to make a spiral mode, but can't seem to get things to behave properly... 

there are no rigidbodies at play yet, once the moving objects are struck by the projectile, I destroy the gameobject and spawn a matching one with a 3d rigidbody and give it an upforce so it has some spinning and such...

I wanted to achieve the same structure to this mode since all those systems are already designed out... but the rotation action is behaving very strangely...

have a watch and see what you think...

https://youtu.be/k2E_tLSuU1Y
« Last Edit: February 02, 2017, 05:34:58 PM by HeathClose »

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: How can I fix this strange rotation behavior? [VIDEO]
« Reply #1 on: February 01, 2017, 11:58:22 PM »
The most likely way I see this being put together, is that the Orbiting Objects are Children of an Empty Game Object.That Empty Game Object is rotating too, causing all it's children to rotate with it.

So, Make your orbiting object a child of your Point, and rotate your point using the "Rotate" Action.  :)

This'll get the movement you want, but now your orbitals are also rotating,  so add an FSM to your orbitals, with the opposite rotation. (So if your Rotating your Centre Point "90" across the Z axis each frame, your children will be rotating "-90" across the Z Axis) keeping the orbitals upright.
« Last Edit: February 02, 2017, 12:20:39 AM by Chizzler »

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: How can I fix this strange rotation behavior? [VIDEO]
« Reply #2 on: February 02, 2017, 10:07:14 AM »
The most likely way I see this being put together, is that the Orbiting Objects are Children of an Empty Game Object.That Empty Game Object is rotating too, causing all it's children to rotate with it.

So, Make your orbiting object a child of your Point, and rotate your point using the "Rotate" Action.  :)

This'll get the movement you want, but now your orbitals are also rotating,  so add an FSM to your orbitals, with the opposite rotation. (So if your Rotating your Centre Point "90" across the Z axis each frame, your children will be rotating "-90" across the Z Axis) keeping the orbitals upright.

I will give that a try and report back... thank you!

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: How can I fix this strange rotation behavior? [VIDEO]
« Reply #3 on: February 02, 2017, 03:57:15 PM »
The most likely way I see this being put together, is that the Orbiting Objects are Children of an Empty Game Object.That Empty Game Object is rotating too, causing all it's children to rotate with it.

So, Make your orbiting object a child of your Point, and rotate your point using the "Rotate" Action.  :)

This'll get the movement you want, but now your orbitals are also rotating,  so add an FSM to your orbitals, with the opposite rotation. (So if your Rotating your Centre Point "90" across the Z axis each frame, your children will be rotating "-90" across the Z Axis) keeping the orbitals upright.

This actually works really well... but when the projectile makes contact with one of the children, I record the point of contact, and then spawn a rigidbody, then use the point of contact as the point of upward force... if it stays a child of the spinning center, that really messes up that variable once I put it on the rigidbody... I need a way for the child to detach itself without detaching the rest of the children when that point of contact variable is recorded....

I looked on the ecosystem, but there is no "detach self"... which would be perfect for this instance...

Is there anyone that can cook that up or knows a workaround?

Chizzler

  • Junior Playmaker
  • **
  • Posts: 67
Re: How can I fix this strange rotation behavior? [VIDEO]
« Reply #4 on: February 02, 2017, 04:44:27 PM »
Record the Object your projectile hit, and use "Set Parent" to None on it to detach it as a child object.

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: How can I fix this strange rotation behavior? [VIDEO]
« Reply #5 on: February 02, 2017, 05:34:42 PM »
Record the Object your projectile hit, and use "Set Parent" to None on it to detach it as a child object.

Perfect!!  Works great, thank you very much for all the help!!