playMaker

Author Topic: Look At Object Keep Vertical Issue [SOLVED]  (Read 1985 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Look At Object Keep Vertical Issue [SOLVED]
« on: July 02, 2016, 09:02:41 AM »
Hi

I have a basic scene setup to explain an issue im having with the 'look at' script, i have tried the original 'look at' and the 'look at 2' scripts. Now i have a scene with 2 players, one faced up and one upside down (rotated 180). Both of them need to follow the player and have the same setup. See attached screenshot.

Now, when i go an run the scene the bottom player instantly flips back to face up in on the World Y axis if i dont check the box 'keep vertical'. If i check this box and it seems to not put the player exactly vertical? it rotates it to a strange angle. Why is this?

Any ideas why it behaves like this? or is it best to restrain the object from rotating other than on the local Y axis? not World axis.

i have recorded a video of what happens.
https://www.dropbox.com/s/rn7v17oqr3bh0am/record.avi?dl=0

Nick

« Last Edit: July 05, 2016, 04:48:20 PM by coxy17 »

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Look At Object Keep Vertical Issue
« Reply #1 on: July 03, 2016, 01:52:38 PM »
I've still been looking and i cant seem to find the solution.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Look At Object Keep Vertical Issue
« Reply #2 on: July 04, 2016, 03:19:58 AM »
Hi,

 You need to define the up vector ( set it to 0,1,0 so that y is the up vector).

There is a sample available on the forum. This may need to be promoted to the Ecosystem :)

 Have a go at this sample if things still don't work on your end, just to verify.

 Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Look At Object Keep Vertical Issue
« Reply #3 on: July 04, 2016, 05:42:50 PM »
Hi Jean,

I tried this any it didn't work, if i put in '-1' it works fine. Not sure why?

I have attached another video for you to show you the behaviour with the vector.

https://www.dropbox.com/s/a57c9byisals0jh/record2.avi?dl=0

Nick

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Look At Object Keep Vertical Issue
« Reply #4 on: July 05, 2016, 03:04:25 AM »
Hi,

 Does the example I linked works? You may have fiddle with this up vector so that it works in your case. it's different for every case depending on the mesh shape really.

 Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Look At Object Keep Vertical Issue
« Reply #5 on: July 05, 2016, 04:48:08 PM »
Hi Jean

Yes that worked great, i didn't realise i had two FSM duplicated so i thought it wasnt working haha. The old test i did was still there and conflicting!

Thanks Jean! you are a great help as usual!