Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[RPH] Get aim direction and bullet impact position

Featured Replies

Hello, I'm trying to get the position of a bullet impact without success. My problem is that I don't know how to do a TraceLine from the player position to the aim direction.

HitResult hr = World.TraceLine(chr.Position, chr.GetOffsetPositionFront(100f), TraceFlags.IntersectEverything, chr);
if(hr.Hit)
{
	Vector3 pos = hr.HitPosition;
	World.SpawnExplosion(pos, 0, 3f, true, false, 0.5f);
}

This piece of code just traces a straight line in relation to the current player position, not what I actually want.

I have tried to create a Camera setting it to the same position and direction of the player and then use this example from documentation but again without success.

The thing is that I have no idea how to make this work. I think about all the possible math with angles and vectors and I'm not a math guy.

 

Thanks!

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Similar Content

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.