I’m trying to make it so when I shoot a target the target is destroyed and I have a blocker raise up to unlock a separate area. I can’t get it to make the other object rise, but I have the target disappear. This is what I have so far:
void OnCollisionEnter(Collision theCollision){
if (theCollision.gameObject) {
Destroy (gameObject);
RaiseBlocker();
}
}
void RaiseBlocker(){
curMoveProportion += (Time.deltaTime / moveTime);
if(curMoveProportion >= 1){
if(targetPos == targetPos1){
targetPos = targetPos2;
} else {
targetPos = targetPos1;
}
prevPos = transform.position;
curMoveProportion = 0;
}
transform.position = Vector3.Lerp(prevPos, targetPos, curMoveProportion);
}