| | | 1 | | using System.Collections; |
| | | 2 | | using System.Collections.Generic; |
| | | 3 | | using UnityEngine; |
| | | 4 | | |
| | | 5 | | public class Ballcanone : MonoBehaviour |
| | | 6 | | { |
| | | 7 | | public GameObject ball; |
| | | 8 | | public Transform SpawnPoint; |
| | | 9 | | public Collider speedRange; |
| | | 10 | | |
| | | 11 | | |
| | | 12 | | |
| | | 13 | | //Start is called before the first frame update |
| | | 14 | | |
| | | 15 | | public void Update() |
| | 7205 | 16 | | { |
| | | 17 | | |
| | | 18 | | |
| | 7205 | 19 | | } |
| | | 20 | | // Update is called once per frame |
| | | 21 | | private void OnCollisionStay(Collision collision) |
| | 15 | 22 | | { |
| | 15 | 23 | | ball.GetComponent<Rigidbody>().velocity = SpawnPoint.position * 2; |
| | 15 | 24 | | } |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | |