using UnityEngine;
Public class Clone: MonoBehaviour
{
Public GameObject playerFab;
Private Rigidbody r;
Void the Start ()
{
R=GetComponent
}
Void the Update ()
{
If (Input. GetKeyDown (KeyCode. Q))
{
Vector3 pos=new Vector3 ();
Pos. X=Random. Range (5-5 f, f);
Pos. Z=Random. Range (5-5 f, f);
Pos. Y=0.5 f;
Float Angle.=the Random Range (0 f, 360 f).
Instantiate (playerFab, pos, Quaternion. AngleAxis (Angle, Vector3. Up));
}
If (Input. GetKey (KeyCode. 1))
{
Of state Richard armitage ddExplosionForce (1500 f, Vector3. Zero, 5 f);
}
}
}
CodePudding user response:
See if there are any error, output a if there is an error in the log will pause button, see if there are any is pressedCodePudding user response:
Hung on the Rigidbody component is casting objects, r should look for the fabrication of, hung on the script object if there is no Rigidbody, should be suspended, since moving