Hello. I am new to Unity and i want to create a prefab object using class. Unfortunetly i dont know how to spawn my prefabricated ball on the scene. Thats my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KontrolerGracza : MonoBehaviour {
public class Gracz
{
public int movementSpeed ;
public int jumpPower;
public bool jumping;
}
public void Spawn()
{
Gracz player = new Gracz();
player.movementSpeed = 10;
player.jumpPower = 900;
player.jumping = false;
}
void Start()
{
Spawn();
}
}