It looks like you're new here. If you want to get involved, click one of these buttons!
Hey Everybody,
I like gum and if you don't then, why? But, I really want to know how to make a working gumball machine! Thank you.
From,
Pandi.
Hope this helps!
If you're not joking, and want to make one in Unity, here is how to do that:
Good luck!
@Mouledoux that was not it but okay, here is the code
using UnityEngine;
public class GumballSpawner : MonoBehaviour
{
public GameObject Gumball;
public float speed = 1f;
// Update is called once per frame
void Update()
if (Input.GetKeyDown(KeyCode.E))
GameObject instGumball = Instantiate(Gumball, transform.position, Quaternion.identity) as GameObject;
Rigidbody instGumballRigidbody = instGumball.GetComponent<Rigidbody>();
instGumballRigidbody.AddForce(Vector3.forward * speed);
}
Looks good 👍️
Keep up the good work.
Answers
Hope this helps!
If you're not joking, and want to make one in Unity, here is how to do that:
Good luck!
@Mouledoux that was not it but okay, here is the code
using UnityEngine;
public class GumballSpawner : MonoBehaviour
{
public GameObject Gumball;
public float speed = 1f;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.E))
{
GameObject instGumball = Instantiate(Gumball, transform.position, Quaternion.identity) as GameObject;
Rigidbody instGumballRigidbody = instGumball.GetComponent<Rigidbody>();
instGumballRigidbody.AddForce(Vector3.forward * speed);
}
}
}
Looks good 👍️
Keep up the good work.