Boo to Instantiate a Prefab

I am running into some trouble when attempting to instantiate a Bullet prefab of mine. Here’s my code:

import UnityEngine

class Shoot (MonoBehaviour): 

	prefab_bullet as Bullet
	
	def Start ():
		pass
	
	def Update ():
		if(UnityEngine.Input.GetButtonDown("Jump")):
			prefab_bullet = Instantiate(Bullet, transform.position, UnityEngine.Quaternion.identity)

I get the following error:

Assets/Standard Assets/Shoot.boo(5,22): BCE0018: The name 'Bullet' does not denote a valid type.

Could somebody please post an example of how to do this and/or give me a tip of what’s wrong?

You want to instantiate “prefab_bullet”, the type should presumably be GameObject, and just use Instantiate without assigning the result to a variable, unless you’re going to refer to it later. Plus the “prefab_bullet” variable should be public. Also you can just write “Quaternion.identity” since you’ve already imported UnityEngine. If you’re not using Start for anything, you can just take it out.

–Eric

Thank you Eric5h5!

Code works just fine now. Making the variable public was important (Python defines all Class variables as public, hence the confusion with Boo).

Remember to link your Bullet prefab to prefab_bullet in the inspector.