Hello, I have this problem I can’t figure out…
I have a base class:
public class Weapon : MonoBehaviour {
public Transform bulletSpawn;
and an inherited class:
public class AssaultRifle : Weapon {
static GameObject PrefabAR = (GameObject)Resources.Load("AR", typeof(GameObject));
static Transform PrefabARBulletSpawn = PrefabAR.transform.GetChild(1).gameObject.transform;
public AssaultRifle()
{
this.weaponObject = PrefabAR;
this.bulletSpawn = PrefabARBulletSpawn;
where the last line above shows error:
Error CS0029 Cannot implicitly convert type ‘UnityEngine.Transform’ to ‘UnityEngine.GameObject’ Assembly-CSharp D:\Unity\Game1\Assets\Scripts\Weapons\AssaultRifle.cs
If anybody could help, that would be really awesome.
The solution is in the error message. Your bulletSpawn is a GameObject, not a Transform. Transform is just a set of coordinates.
1 Like
Well if it were that easy right, but it is not. BuletSpawn is defined as Transform public Transform bulletSpawn;
When I hover over the text it also shows (field) Transform Weapon.bulletSpawn
and (field) Transform AssaultRifle.PrefabARBulletSpawn
I really appreciate the fast help, I am probably just missing something and I just can’t find it 
If it’s a Transform, then it is the place where you want to spawn a game object (a bullet, I suppose). Did you make a confusion between the two somewhere in your script? Like try to spawn the spawn coordinates instead of the game object?
1 Like
So I have restarted Visual Studio and the error disappeared. Sometimes I am just wondering why, why me ? 
Thank you for trying to help.