GregLeck

ctest1

Jan 6th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SphereLogic : MonoBehaviour
  6. {
  7.     Rigidbody m_rigidBody;
  8.  
  9.     // Start is called before the first frame update
  10.     void Start()
  11.     {
  12.         m_rigidBody = GetComponent<Rigidbody>();
  13.     }
  14.  
  15.     // Update is called once per frame
  16.     void Update()
  17.     {
  18.         if(Input.GetKeyDown(KeyCode.Space))
  19.         {
  20.             m_rigidBody.AddForce(new Vector3(0, 1000, 0));
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment