playMaker

Author Topic: Look At Object Issue [SOLVED]  (Read 1921 times)

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Look At Object Issue [SOLVED]
« on: January 04, 2016, 08:01:37 AM »
Hi

I have a game which uses an object which is used in different positions in world space. I created a object and want it to track my character and remain vertical whilst doing this action. Ive used the LookAt script and works ok when my objects axis matches the world space axis on XYZ.

However, all i have done is made a copy of the object and rotated it to face upside down but i want it to remain upside down and track the player. But when i go an run the game it instantly flips the object back facing up right and hen tracks he player. Why is this? I thought the principal would work for any rotated object.

Hope im making sense. Ive attached a diagram to explain further.

Nick
« Last Edit: January 05, 2016, 06:49:25 AM by coxy17 »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Look At Object Issue
« Reply #1 on: January 04, 2016, 08:24:46 AM »
You can try using an up vector to always have it point up correctly- you can also try the smooth look at action which has a couple different options
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Look At Object Issue
« Reply #2 on: January 04, 2016, 09:03:42 AM »
Hi

Ok i have taken a look and i'm finding it hard to work out. Ca i get the objects Local Vector? rather than world vector? as ive noticed that the object keeps flipping back as it doesn't realise that my object is upside down.

To summarise i'm after an upside down player looking at an object but remains up based on its local Y axis.

I'm thinking this wont be possible

Nick

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Look At Object Issue
« Reply #3 on: January 05, 2016, 06:38:58 AM »
Have you tried to set the "Up Vector" on the look at action to 0,-1,0 so Y faces "-1" instead of "1"? All so I'm not sure if "keep vertical" prevents that behaviour to begin with.

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Look At Object Issue
« Reply #4 on: January 05, 2016, 06:49:13 AM »
That worked great. The minus one (-1)

Cheers!