Ultimate Character Controller Magic Projectile Aim is Offset

The aim is offset and I need to correct the aim to be within the crosshairs. I'm not sure where to begin on this. Please advise on how I can correct this. Here's a link to a video that shows the issue.
 
Does the aim offset work correctly in the demo scene? Are you able to reproduce the problem within that?
 
Projectiles will not just align with the direction to the crosshair, as the projectile is spawned from the character's transform, which is obviously different from the camera's in a third-person view. So the angle to the crosshair will be different.

If you want to align the projectile exactly with the crosshair, you may need to change the way magic projectiles are spawned. You could do this by creating a custom Cast Action that overrides SpawnProjectile. I imagine the part you'd need to change is the velocity of the spawned projectile - this is done within SpawnProjectile.Cast, specifically line 85: projectile.Initialize(direction * m_Speed, Vector3.zero, m_GameObject, m_MagicItem, m_CastID); The first argument of Initialize sets the velocity of the projectile.
 
Projectiles will not just align with the direction to the crosshair, as the projectile is spawned from the character's transform, which is obviously different from the camera's in a third-person view. So the angle to the crosshair will be different.

If you want to align the projectile exactly with the crosshair, you may need to change the way magic projectiles are spawned. You could do this by creating a custom Cast Action that overrides SpawnProjectile. I imagine the part you'd need to change is the velocity of the spawned projectile - this is done within SpawnProjectile.Cast, specifically line 85: projectile.Initialize(direction * m_Speed, Vector3.zero, m_GameObject, m_MagicItem, m_CastID); The first argument of Initialize sets the velocity of the projectile.
Thank you! I will dig in on this tomorrow. I needed a place to start and this should do it. I'll let you know how it turns out.
 
Although I can find my way around in the code, I’m not a coder and I didn’t understand how changing the velocity would affect the position of the hit point of the projectile unless it was due to dropping along the y axis over a longer distance. Distance dropoff wasn’t the issue here.

The way I approached the solution was through changing the Origin transform for each Cast item that was a child of the Items game object that was a child of the Hand game object of the skeleton. I just tweaked the Origin transform until I got the Magic Projectile hit point in the center of the Crosshairs.
Magic Projectile Aim Offset Fix01_Origin Point Tweak.jpg


The Magic Projectile hit point was still off center for the Zoom state for each of the Magic Projectiles. I solved this by creating a new “Zoom” state preset in the Cast Actions section in the Magic Item script for each Magic Projectile. I made sure that although each Preset had a different name in my project, they were all named “Zoom” so that the new Zoom state would be called when the player engages the Zoom.
Magic Projectile Aim Offset Fix 02_ZoomStatePreset .jpg


In each of the new Presets I created a Transform Offset property and tweaked it until it was corrected for each of the Magic Projectile items while in the Zoom state.
Magic Projectile Aim Offset Fix 03_ZoomStatePresetTweak .jpg


I still need to tweak it a bit but it's much more acceptable now.
 
Top