altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

``Player.aimPos`` return wrong position

Open xDavidos opened this issue 1 year ago • 1 comments

Description of the problem

Returns the wrong position

Reproduction steps

  1. Give weapon
  2. Get aimPos while aiming
const player = alt.Player.local;
const timerId = alt.everyTick(() => {
    if (player.isAiming) {
        alt.log(player.isAiming, player.aimPos, player.pos)
    }
})

await alt.Utils.wait(3000)
alt.clearEveryTick(timerId);

Expected behaviour

Return the correct position

{ x: 213.29640197753906,
  y: -938.8253173828125,
  z: 30.674699783325195 }

Additional context

player pos

{ x: 207.47805786132812,
  y: -947.2433471679688,
  z: 30.686811447143555 }

player rot

{ x: 0, y: 0, z: -0.595000147819519 }

aimPos return:

 { x: -68.32180786132812,
  y: -98.47076416015625,
  z: -0.0203094482421875 } 

Operating system

Windows 11

Version

dev/15.0-dev918

Crashdump ID

No response

Confirmation of issue's presence

  • [X] By submitting this ticket, I affirm that I have verified the presence of this issue on the latest developer version available at the time of writing this ticket.

xDavidos avatar Dec 01 '23 16:12 xDavidos

@xDavidos please add the values you receive and the one you expect.

ThomasMarangoni avatar Dec 03 '23 23:12 ThomasMarangoni