I have a GameObject called 'Player' with a GameObject called 'FirePoint':
Further I wrote a very basic c# Script 'Weapon':
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Weapon : MonoBehaviour
{
public Transform firePoint;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
I dragged the script on the Player GameObject and now it is shown in the Inspector. Within the Script I would like to use the FirePoint, that is in Player. The only way to do so I know is, to drag the FirePOint into the place holder:
I want to avoid the manual drag and drop, because I want to spawn new Players with their own FirePoints during the game. How can I do that programmatically? I could not find any tutorial (maybe because I don't know how to search for it), so I would also be glad to have a link to an easy tutorial that addresses this problem.

