im creating a top down shooter, i have this gun attachment thats supposed to flash enemies but when Instantiating the vfx the rotation is messed up, please help me, if you need any more info feel free to ask
#Need help with Instantiating particle system with the right rotation.
1 messages · Page 1 of 1 (latest)
I think you are rotating around the wrong axis in
Vector3 FlashVFXrot = new Vector3(weapon.transform.parent.rotation.z, 90, -90);.
I wouldve Expected something like new Vector3(0, 0, weapon.transform.rotation.z);.
have tried it but then particle system goes circle like this
Try:
GameObject vfx = Instantiate(
flashVFXPrefab,
weapon.FirePoint.position,
weapon.transform.rotation
);
or if FirePoint is a Transform thats setup correctly use weapon.FirePoint.rotation instead.
Are both the weapon and the VFX setup such that their orientation should align?
btw if the particle system becomes a circle, it means that it is pointing to or away from the camera.
You should be never be touching or even thinking about transform.rotation.z to be perfectly honest.