0
Under review

look at a local variable does not work properly

NEO 1 month ago in Game Creator updated by Marti (Lead Developer) 4 weeks ago 7

action look at to a variable does not work properly and it seems it always look at  position(0,0,0)


this is how I tested

I'm trying to make Player to look at Cube

Player have a local variable 'target' referencing the Cube

and excute. Player does not look at the cube

https://support.gamecreator.io/communities/1/topics/193-when-using-actionlookat-to-look-in-the-direction-of-a-localvariable-object-the-character-looks-to

it seems similar to this link but I'm not sure

Unity version:
2019.4.1f1
Game Creator version:
1.1.9

On your player is 'Is Controllable' checked?

Just to test, can you try replacing the look action with the rotate action? Might help identify the problem.

Also, I would try moving your 'Target' variable off of the player. I'm no expert but it is something to try.

thank you for the reply.


Is Controllable is checked.
I just tried moving Target and the Player still the Player rotates to 0,0,0 when the action excuted

tested 3 actions 'character rotate towards', 'transform rotate towards' and 'look at' and the results were same

When you play your scene have you tried looking at your actions to see where they get stuck?

Try rebuilding your actions from scratch with the Target variable not on the player.

Only other thing I can think of at this moment is to make sure the problem is not with your trigger. What trigger are you using?

the actions are executed and rotated but the direction is wrong

'transform rotate towards' with non character and the result is same.

I just tried triggers like key press 'f' or mouse click and 'debug play button' and all the triggers works well

Hi, so I just got home and tested it. First I tried to implement the player to look at a cube via a local game object variable, on a pre-existing scene, AND it did not work, when I pressed the trigger it made my player look at 0/0/0 as you described.

I also made a new scene from scratch and it still just makes the player look at 0/0/0 instead of the local variable gameobject.

I am guessing this must be a bug.

yes exactly thank you for the test!

Under review

Although I'm opening a ticket to take a more thorough look at this, the Look At should be really renamed to "Transform Look At".

A character should use the Head Track action to rotate the head towards a specific point (or use a Hotspot), or use the Character Direction Action to pivot the body towards a specific object.

The Look At action is aimed to be used on simple game objects without any logic.