Home > other >  [with] about unity problems after instantiate the object
[with] about unity problems after instantiate the object

Time:09-16

This is a shield of prefab
Its role is to destroy local bullets, can implement effect,
After I will instantiate it generated after destroying local bullet in front of my father object disappears, the effect of 3 s self-destruct after are still in effect,
 using System. The Collections; 
Using System. Collections. Generic;
using UnityEngine;

Public class Defence: MonoBehaviour
{
//Start is called before the first frame update
Public float Right_last=3 f;
Public GameObject D_VA;
Void the Start ()
{
}
//Update is called once per frame
Void the Update ()
{
Right_last -=Time. DeltaTime;
If (Right_last & lt;=0)
{
Destroy (enclosing gameObject);
}
}
Private void OnTriggerEnter (starts other)
{
If (other.gameObject.Com pareTag (" enemybullet ")) Destroy (other. GameObject);

}
}
this is shield source, want to ask the reason and solution,

CodePudding user response:

24. Until now, nobody answer,,,

Said I didn't see, are you going to realize what function! What problems!

Please wisp of a wisp of your demand again.

  • Related