I am trying the following:
Whenever the spacebar is pressed, a Thunderball spawns from the opponents head (through a sphere spawnpoint) and add a force to move down, like a thunder strike
i have been coding for a couple of minutes and already have a problem
// Cast Thunder on the Cube
if(Input.GetButtonDown("Jump"))
{
var ThunderBullet = Instantiate(ThunderBullet, GameObject.Find("SpawnPoint").transform.position, //something to cast the thunder to go down// );
}
Here is the code;
I get the Nullreference error (object reference not set to an instance of an object)
Here is what i’m using to achieve this:
Cube (Opponent, Standing still)
Sphere (SpawnPoint, child of ^Cube^)
Capsule (Character)
ThunderPrefab (The Thunderball)
var Thunderbullet:Transform; (on the script)
Can anyone help me here? I am equal to a sloth when it comes to coding