Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Добавить в Utility:
- rotationToDirection(rotation: Vector3) {
- const z = this.degreeToRadian(rotation.z);
- const x = this.degreeToRadian(rotation.x);
- const modifier = Math.abs(Math.cos(x));
- return new alt.Vector3(-Math.sin(z) * modifier, Math.cos(z) * modifier, Math.sin(x));
- }
- degreeToRadian(degree: number) {
- return (degree * Math.PI) / 180.0;
- }
- Добавить в Raycast.line:
- вместо:
- let playerForwardVector = game.getEntityForwardVector(this.player.scriptID);
- playerForwardVector.x *= scale;
- playerForwardVector.y *= scale;
- playerForwardVector.z *= scale;
- let targetPos = this.getTargetPos(this.player.pos, playerForwardVector);
- добавить:
- const rotation = game.getGameplayCamRot(1);
- const direction = Utility.rotationToDirection(rotation);
- direction.x *= scale;
- direction.y *= scale;
- direction.z *= scale;
- const targetPos = this.getTargetPos(this.player.pos, direction);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement