Magic Action spawn multiple projectiles with diffirent direction

vodinh

Member
Hi,
Currently, I see that the direction of the projectile depends on the direction of the caster module. (None, Forward, Target, Indicate)
If I want to spawn multiple projectiles in different directions, what should I do?
Currently, I have handled it by writing another spawn projectile and using transform.forward of the projectile itself.
I think there must be a more optimal solution?

1680713014610.png
 
Creating a new spawn projectile is definitely a solution, alternatively you can create a new spawnable projectile module which uses a different look direction.
 
Creating a new spawn projectile is definitely a solution, alternatively you can create a new spawnable projectile module which uses a different look direction.
Thank you for support.
After solving the projectile direction problem. Is there a way to use "trigger" instead of projectile "collider". I want it to continue moving after collision until it lifespan. Like a Tornado skill that can move through enemies.

1680792372753.png
 
Ok, After reading the code in TrajectoryObject.cs, I found that there is processing for the case where Collider is Trigger is not supported and is converted to "No collider attached" in the Cast function.
hitCount = Physics.RaycastNonAlloc(position, direction.normalized, m_CombinedRaycastHits, direction.magnitude + c_ColliderSpacing, m_ImpactLayers, QueryTriggerInteraction.Ignore);
The small distance direction.magnitude + c_ColliderSpacing leads to the case where the projectile goes through the target without detecting a hit.
In addition, in my case, the position of the projectile has a y-coordinate of 0 and the raycast may not have detected the capsule collider.
1680801697204.png

I think you should choose the type of Physics cast and provide the necessary parameters for that type of cast instead of taking from Collider like SphereCastNonAlloc, CapsuleCollider provides radius.
 
I can add this to my list. In the meantime editing the script as you are is a good solution :)
 
Top