playMaker

Author Topic: Resetting the character's rotation [SOLVED]  (Read 2077 times)

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Resetting the character's rotation [SOLVED]
« on: February 27, 2013, 05:15:51 AM »
I'm having trouble doing as the title suggests resetting the character's rotation.

It's probably easiest to show you my build.

When you pause and hit restart I want to reset the player's position and rotation to the same as when they started. It's working fine for the position (using set position) but has no effect on the rotation (using set rotation) of the character controller object (capsule). I can set the camera (which is a child of the capsule) rotation independently but then the movement and camera get out of sync.

I've tried every kind of set property/variable/transform/etc that I can find but nothing seems to work.

I even tried putting in a cube that doesn't render and setting the character to look at it upon restarting but it only works while that action is active. Which it can't remain without linking the cube's movement to the capsule and creating a dependency loop.

So, any ideas? :)
« Last Edit: February 27, 2013, 07:45:35 AM by Mr-Brett »

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Resetting the character's rotation
« Reply #1 on: February 27, 2013, 06:20:03 AM »
Just an idea, but have you tried destroying the game object totally, with Destroy Object, then Creating it after reload (which isnt really a reload, just a reposition) an actual reload of the level would probably work too..

Nice model by the way!

Mark

Mr-Brett

  • Playmaker Newbie
  • *
  • Posts: 22
  • Not very technical Artist
    • Portfolio
Re: Resetting the character's rotation [SOLVED]
« Reply #2 on: February 27, 2013, 07:45:09 AM »
Oh dear, I just found reload ('restart level' right?), I can't believe I hadn't noticed it before. It does the job, I didn't really want to completely restart the level but it's close enough.

I guess I'll mark this solved. If anyone knows why the rotation doesn't work then I'd still like to know though. My guess is something to do with the character controller overriding it.