Instaited projectile Ignores the player's rotation

Hey, I’m new to unity and i’ve been having some issues trying to instantiate a projectile where the player is currently looking that is rotated depending on the player’s “cameraHead” rotation (which is an gameobject inside the player that takes on the role of a camera.) I was following a tutorail and no one else seemed to have this issue and I don’t know enough of C# to be able to code effectively in it.

I heard fourms were a great place to find advice and solutions to this please take a look and tell me what i’ve done wrong or what an easier way of going about it is.

using UnityEngine;
using System.Collections;
/// <summary>
/// This script allows the player to fire the "Blaster" projectile
/// </summary>


public class FireBlaster : MonoBehaviour {
   
    // Variables
    // The blaster projectile is attached in the inspector
   
    public GameObject Blaster;
   
    // Refences
   
    private Transform myTransform;
   
    private Transform cameraHeadTransform;
   
   
    // Postion where the projectile will be sqawned
   
    private Vector3 lauchPostion = new Vector3();
   
    //Variables
   
   
   
   
    // Use this for initialization
    void Start ()
    {

        myTransform = transform;
        cameraHeadTransform = myTransform.FindChild("CameraHead");
           
    }
       
   
    // Update is called once per frame
    void Update ()
        {
   
    if (Input.GetButton("Fire Weapon"))
        {
            //This is where the projectile spawns which is just infront of the cameraHead.
            lauchPostion = cameraHeadTransform.TransformPoint(0 , 0 , 0.2f);
           
           
            //Create blaster at launch postion and tilt its angle so it is horizontal
            Instantiate(Blaster, lauchPostion,Quaternion.Euler(myTransform.eulerAngles.x + 90,
                                                               myTransform.eulerAngles.y, 0));
        }
    }
}

Oh yeah, and the reason the “blaster” (the projectile) is spawned and then rotated 90 is because its “point” is facing upwards by default.

You can take cameraHeadTransform.forward to get its pointing direction
(or depending what direction is forward for your object, try cameraHeadTransform.right, cameraHeadTransform.up etc)

So to have little offset could work as (not tested)
lauchPostion = cameraHeadTransform.position+cameraHeadTransform.forward*0.2f;

Other option would be to add empty launchPoint gameobject as a child to “cameraHeadTransform” at good position,
and instantiate to there. (it would then follow the cameraHeadTransform rotation)

Thanks for replying, those look they will work!
1 Question my projectile modifies its transform according to time.delta in order to move.
Why would I use the “rigibody” addforce when they both seem to do the same thing.

If your object has a rigidbody and is controlled by physics (not kinematic) you should always move it with AddForce or MovePosition or similar, never by moving its transform.

This is just due to how the physics system works.