Projectile doesn't go towards crosshair's direction!

Tell me… if you play a game with a friend, and your friend shoots a Missile… and you see the Missile coming out FROM YOUR FRIEND’S EYES rather than your friend’s weapon… what would you say? **That the game sucks? Yes, me too.
**
I know a game where this happens, here’s a screenshot:

Oh my gosh, where’s the Rocket coming from? From the player’s eyes! That’s horrible!

What if it were a grenade? Oh, it would look like the player just throws away one of his eyes… XD please, that’s horrible.

It would have been way more beautiful to see the Rocket come out from the MuzzleFlash of the weapon.
AND every weapon has its OWN MuzzleFlash.

I mean, the Muzzle isn’t a FIXED Socket. I may have a Shotgun long half a meter, and I may have another shotgun long 1 meter.

Each of those has a **DIFFERENT **Muzzle Socket position.

What do they have in common?

The damned center of the screen:


    FVector CameraLoc;
    FRotator CameraRot;
    MyOwner->GetActorEyesViewPoint(CameraLoc, CameraRot);

Uh hey, I already did it :cool:

There’s a good start with the ShooterExample code. Apparently, he seems to do what I wanted to do since the beginning…

ShooterWeapon_Projectile::FireWeapon() ]


// ShootDir contains the center of the screen. GetAdjustedAim() just returns the equivalent of my CameraRot.Vector()
FVector ShootDir = GetAdjustedAim();

// Origin is the MuzzleFlash of the Current weapon
FVector Origin = GetMuzzleLocation();

Okay, that was the first step that I did too.

The second step:


// trace from camera to check what's under crosshair ### WHY? ###
const float ProjectileAdjustRange = 10000.0f;
const FVector StartTrace = GetCameraDamageStartLocation(ShootDir);
const FVector EndTrace = StartTrace + ShootDir * ProjectileAdjustRange;
FHitResult Impact = WeaponTrace(StartTrace, EndTrace);

Okay. Super question: why this? What are they trying to do with that?

If I AM IN POSSESSION of the CameraRotation (thus, the center of the screen) stored inside the ShootDir variable… why do I need to LineTrace?

Maybe for the reason you described in post #6?

My head is gone…