Forum: PogamutUT2004

Shooting Direction

Hi

Basically I'm trying to make the bot shoot like human player does, but I need the player's shooting direction from the observer class.
Is there any way to get the player's shooting direction or target from observer class? So I can use that info to calculate the angle or location for performing the shoot action.
Hi!

Well, I would stick with Rotation attribute. Basically you never know what is player trying to hit, so the rotation attribute is the only information you can work with. Rotation pitch and yaw should provide the information where the player is aiming.
With the bots the situation could be different, cause we could export target/location they are shooting at (this would require small code change).

best,
Michal
But then again, Rotation only contains yaw information. It doesn't give me any pitch or roll info. Is there something missing in Gamebots for Rotation data?
Well, that means there is a bug in Rotation exporting. The issues are only with player rotation obtained through observer, right? I'll look into it asap.

michal
I tested with bot connection as well, the issue is still there. Rotation info only returns yaw info for both.
Ok, I've fixed it. Download latest GameBots2004 version from SVN. I've fixed Rotation attributes in observers Self message and Player messages for bots, control servers and observers.

Best,
Michal
Thanks, it's working perfect now