[workshop] look at the host player

Hello,

I’d like my AI to look towards the host player, but when I put in action “Look towards” and instead of vector I put “Host player”, my AI doesn’t change its direction head, but it does the other things it has to do after in the script.

Can someone help me?

Thank you

I don’t know where the bot is or what hero it is so you with have to change that. When I type in [ ] That’s me talking not code. I made code for two scenarios. This first rule is if the dummy bot is always facing the host player. Then second two are if something happens that would activate it.:slightly_smiling_face:
Always facing the host player:
Create Dummy Bot (Hero(Ana), All teams, -1, Vector(0,0,0), Host Player)

Has to be activated:
Create Dummy Bot (Hero(Ana), All teams, -1, Vector(0,0,0), Vector (0,0,0))

(This goes after the condition that would activate it)
Set Facing(Players in slot ([Slot the bot is in],[Team of dummy bot], Host Player, To World)

Try using Direction Towards(Eye Position(Event Player), Eye Position(Host Player)), assuming that Event Player is your AI.

1 Like

thank you but it still don’t work… i.a dont look at me :c

Can you post the relevant rule/rules please, so we can look for errors?

I suppose you mean the action “Start Facing”?

Short explanation on how to use vectors as directions:
Lets assume the host player is standing on position (0, 0, 1) and the bot is standing on position (1, 0, 1).
If you put “host player” as facing direction of the bot, you are actually giving it the direction (0, 0, 0) --> (0, 0, 1) as direction. The direction will be added to the position of the bot and as result the bot will look towards the position (1, 0, 2).
So the direction you actually want is the direction of the “bot position” --> “host position”, wich would be (-1, 0, 0). Calculation: (0, 0, 1) - (1, 0, 1) = (-1, 0, 0).
As workshop action you need to use one of those 2 options:

  • Direction Towards(*bot*, *host*)
  • Subtract(*host*, *bot*)

my game is in french so you will not understand anything ^^’

In that case you could post a code to the gamemode - Overwatch should translate it for other regions when used

I edited my first post.

Afaik, keywords will still be in english. So just go ahead :slight_smile:

here the game game code : WGDD0
There is only 4 rules, the problem is on last one :slight_smile:

You may call me lazy, but launching overwatch just to check your code takes a lot of time.
If you would paste your relevant rules here I could give it a quick look. Otherwise I can only look into it when I have enough time to do so.