Lerpz tutorial problems

Hi guys, firstly I’m a new kid around here. Well met.

Now for the questions, I’ve got a few questions about the Lerpz / 3D Platformer Tutorial. Currently I’m on the Adversaries chapter. I’m experiencing this problem. BTW, I’m using the newest Unity v 3.5, maybe it has something to do with my problem.

The laser game objects can’t do a collision at all. I’ve done all the necessary steps like the one in the tutorial’s pdf. I even added a Debug.Log in the “if (hit.collider.tag == “Player” || hit.collider.tag == “Enemy”)” block. But they didn’t get triggered at all. But if I put the Debug.Log at the first line in the Update() function it got called, so the script itself is working. What did I do wrong here?

Thanks in advance…

When I did the Lerpz tutorial it was out of date, it was built for Unity 2.x and I was using 3.0 at the time. But perhaps Unity have updated it since then.

Off the top of my head I would say: place a debug statement outside any ifs in the collision callback, check your tags, check the name of the callback against the API reference, and most importantly double check the origin and direction of the ray cast. The latter you can visually inspect when you run the game in the editor by using Debug.DrawLine, but you have to have Gizmos turned on in game view (upper right).

Welcome to Unity :slight_smile:

Ok, the problem is solved. I’ve forgotten to tag the player so everytime the laser hits the player, it is recognized as “Untagged”. A little tips here for the tutorial’s document, maybe you guys should added that the developer trying this tutorial should re-check again for the tag of the player. Thanks.