Question by
kingofstreets · Feb 08, 2017 at 04:26 AM ·
2d2d game2d-platformer
2D platform dstroy script
var platHeightY : float;
var platform : Transform;
var destroy : Transform;
var DheightY : float;
function Start () {
platform = GameObject.FindGameObjectWithTag("ground_solid" && "jumpPlat").transform;
destroy = GameObject.FindGameObjectWithTag("Respawn").transform;
}
function Update () {
platHeightY = platform.position.y;
DheightY = destroy.position.y;
if(platHeightY < DheightY) {
Debug.Log("hit");
Destroy(platform.gameObject);
}
}
it won't destroy the platform after they are below the level and no error msgs and also the debug log is not getting triggered, can anyone help? idk why it's not working i used this same script for re-spawning my player and it works with that.
Comment
Your answer
Follow this Question
Related Questions
KillPlayer, Null Reference Exception. 2 Answers
Fix soooo hight jump 1 Answer
What is the Easiest Way to Check if Two Time Periods are Overlapping 0 Answers
Tilemap doesn't showing on window?? unity 5.6.1f1 ,Tilemap not showing on the Window or as 2D Object 0 Answers
Collision Not regestering 1 Answer