View Issue Details

IDProjectCategoryView StatusLast Update
0004325Multi Theft Auto : San AndreasClientpublic2018-09-20 20:54
ReporterFenix1053 Assigned To 
Status closedResolutionsuspended 
Summary0004325: setPedLookAt does not work for remote players
for key, value in ipairs(getElementsByType("player")) do
    local rot = getPedCameraRotation(value)
    local x, y, z = getElementPosition(value)
    local vx = x + math.sin(math.rad(rot)) * 10
    local vy = y + math.cos(math.rad(rot)) * 10
    setPedLookAt(value, vx, vy, 10, 3000)

This will work for the local player, when it comes to a remote player it will return true but you will not see that players head move.

After outputting the values from getPedCameraRotation and the vx, vy values, they are definately changing for when the remote player moves his head, meaning this bug is within setPedLookAt.

Also try:

crun setPedLookAt(getPlayerFromNick("name"), 0, 0, 0, -1)

You will not see his head move, despite it returning true.

TagsNo tags attached.


has duplicate 0007390 closed New issues setPedLookAt on remote players 
has duplicate 0003741 closed Multi Theft Auto : San Andreas setPedLookAt doesn't work for remote players 
has duplicate 0007545 closed New issues setPedLookAt goes wrong for other players 
has duplicate 0008123 closed New issues setPedLookAt doesn't work for remote players 



2009-06-29 07:41

reporter   ~~0009803

I had requested this to be closed, but I've managed to reproduce it now under the latest nightly.

If you specify any location, the remote player is always looking up and to the right.

Untested with Peds, works fine with the local player.


2010-03-12 21:26

viewer   ~~0011154

With peds created by server - doesn't work too. Some times ped lookin to right or doesn't change look_at position


2010-06-14 03:36

viewer   ~~0011594

Last edited: 2010-06-14 03:41

i can confirm this, seem to works for a bit and after the head keeps looking/locked to right.


2010-06-21 00:05

viewer   ~~0011631

It doesn't work at all, the ped just looks at 0, 0, 0... so it does look at something.


2010-08-12 19:35

viewer   ~~0011961

Last edited: 2010-08-12 19:37

I tried to sync head movement using setPedLookAt, setElementData and getElementData. Unfortunately remote players will ever look to the right when using setPedLookAt - that's exact the same result as described above. Is there a chance to see this fixed in Version 1.1? Tried both in 1.0.4 and 1.0.3.

Also reported in #0003741


2010-08-13 11:12

viewer   ~~0011963

Try to move your peds around center of the map (0, 0, 0 co-ordinates), they look directly in this place.


2011-05-14 15:08

viewer   ~~0013405

Is there a chance to get this fixed/integrated in future versions?


2012-07-07 23:03

viewer   ~~0016994

Last edited: 2012-07-07 23:06

For unsynced NPC's clientside works - idk serverside and idk synced.

I can record a video if needed.


2013-03-22 12:11

reporter   ~~0018267

And with use setPedAimTarget for remote player before setPedLookAt fixes bug...
So I think the problem is in the code of sync players target


2013-09-11 18:44

viewer   ~~0019310

Last edited: 2013-09-11 18:45

With 1.3.4 it's still possible to use setPedAimTarget() to fix setPedLookAt() for remote peds.

However, if that remote ped is in a vehicle the workaround fails and the ped keeps facing to blueberry 0/0/0.


2014-03-29 00:14

viewer   ~~0020493

I guess, nobody of the mods wish this fixed.


2014-09-19 00:07

viewer   ~~0022031

Holy shit, I can't believe this bug has been there for 5 years. About damn time to start fixing this and stop being so greedy about money and start showing MTA fans that you care without money all the damn time.

This is how it works on MTA now days, you want something fixed you better start paying for it or it wont get fixed. I'd easily pay for this, but I'd only do so if I knew that it wasn't all about money...


2014-09-27 19:07

viewer   ~~0022087

123B3n, that's great that you don't care about money... so when you'll submit a patch to fix this?


2014-10-02 18:11

viewer   ~~0022123

@W would be my pleasure I'm not lazy and I'd be glad to help out. Send me all the things I need and I'll start debugging the function and hopefully I'll find the problem and fix it.


2015-01-02 17:02

viewer   ~~0022783

Can confirm that this bug is happening.

Issue History

Date Modified Username Field Change