Placing particle relative to character code

Hey guys. I have created code to find specific points around the camera, and I need to create a particle relative to the camera on update. I need the code to update every frame however, so the code can not be too memory intensive. Any ideas on how this is possible?

Your question isn’t very clear, but what I understand from it is that you’re looking to have a “particle” (by which you mean GameObject or ParticleSystem, I presume) stay in the same position relative to the camera regardless of when or where the camera moves.

If that’s correct, the simplest solution seems to me to be to make the “particle” a child of the Camera object if that’s possible. That will mean that you don’t have to do any of the work yourself; Unity will take care of it for you.

You can make a GameObject a child of another by either selecting it in the Hierarchy and dragging it over the Camera there, or in script by using something like:

 particle.transform.parent = MainCamera.transform;

If you can’t (for whatever reason) make the “particle” a direct child of the Camera, you could instead use an Empty Game Object. Then, on Update, simply assign the position of the “particle” to be the position of the EGO.