bruh
This commit is contained in:
1 parent
0d5e6b6dec
commit
c12d653cbc
647 files changed
+194585
-117
No files matched your search
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace KinematicCharacterController.Examples
|
||||
{
|
||||
public class PrefabLauncher : MonoBehaviour
|
||||
{
|
||||
public Rigidbody ToLaunch;
|
||||
public float Force;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Return))
|
||||
{
|
||||
Rigidbody inst = Instantiate(ToLaunch, transform.position, transform.rotation);
|
||||
inst.AddForce(transform.forward * Force, ForceMode.VelocityChange);
|
||||
Destroy(inst.gameObject, 8f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user