Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: serenefox on September 13, 2018, 03:29:39 PM

Title: [Solved] Look At 2d but Direction instead of GameObject?
Post by: serenefox on September 13, 2018, 03:29:39 PM
Hi,

I am trying to get my 2d sprite to look at a direction, but it won't work properly. The lookat 2d action works but I need to to look at a Vector 2 direction instead of just a V2 point in space. Any ideas? I tried smooth look at direction but the sprite keeps flipping around the wrong way not matter what up vector I have.

Thanks!
Title: Re: Look At 2d but Direction instead of GameObject?
Post by: jeanfabre on September 14, 2018, 02:09:11 AM
Hi,

 You can get the direction by substracting your target position with your sprite position?

Meanwile, I'll if I can make that action.


 Bye,

 Jean
Title: Re: Look At 2d but Direction instead of GameObject?
Post by: serenefox on September 14, 2018, 10:44:39 AM
Hi Jean,

I am getting the direction from the “Get axis vector” action. I just need to feed that direction into a “look at” action some how so my arrow sprite will point that way. The problem I am having isn’t getting the direction, it’s that I can’t figure out how to get the look at to work properly.
Title: Re: Look At 2d but Direction instead of GameObject?
Post by: serenefox on September 14, 2018, 07:40:08 PM
Nevermind I figured it out. I used a dummy parent game object and manipulated that with the smooth look at direction which I did before but apperently not the right way. For 2D I had to change the child object’s rotation to be 270 in the X, 0 in the Y and 180 in the Z.