Chuck Terzian
Member
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.
The aim offset is perfect in the demo scene but I was only able to check the shootable weapon and not the magic projectile.Does the aim offset work correctly in the demo scene? Are you able to reproduce the problem within that?
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.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.