Thursday, 12 March 2015
An excellent Unity tutorial site
Found this cool site called noobtuts where there's lots of Unity 2D/3D tutorials (plus tutorials for C++, Python, Java and other stuffs too), I am currently learning all the Unity 2D ones and really enjoy it. Strongly recommended!
Sunday, 8 March 2015
Can't get onTriggerEnter to work in "Roll-a-ball" tutorial?
Was following the "Roll-a-ball" tutorial but can never get the "OnTriggerEnter" to work in the "05. Create pick-up objects" module.
The settings for player object is as below:
The settings for the Prefab object "Pickup" is as below:
When the "Is Trigger" for Box collider in "Pickup" prefab is ticked, the sphere/Player object just went through the "Pickup" object as if it does't exist, and "onTriggerEnter" in the "PlayerController" script (attached to the Player object) does not get called. When it's not ticked, the sphere/Player object will bump into the Pickup object and stopped.
Found this similar question in answer.unity3d.com, however it's due to typo in the "Tag" name. To avoid confusion, I later purposely renamed my tag to "PickMeUp", plus added a few Debug.log in onTriggerEnter in the "PlayerController" script as shown below. So that even if the tag name doesn't match, there should be at least a line "enter onTriggerEnter" been logged on the console when it was called, but strangely nothing gets logged...
I am on Unity 4.5.2. Both the player and Pickup objects have collider and rigidbody component added. What else could be wrong? I am totally confused....
[Update]
Asked question in answers.unity3d.com
[Update]
Question got rejected, because it should be "OnTriggerEnter", not "onTriggerEnter" - needs upper case "O", silly me. Certainly a big lesson learned.
The settings for player object is as below:
The settings for the Prefab object "Pickup" is as below:
When the "Is Trigger" for Box collider in "Pickup" prefab is ticked, the sphere/Player object just went through the "Pickup" object as if it does't exist, and "onTriggerEnter" in the "PlayerController" script (attached to the Player object) does not get called. When it's not ticked, the sphere/Player object will bump into the Pickup object and stopped.
Found this similar question in answer.unity3d.com, however it's due to typo in the "Tag" name. To avoid confusion, I later purposely renamed my tag to "PickMeUp", plus added a few Debug.log in onTriggerEnter in the "PlayerController" script as shown below. So that even if the tag name doesn't match, there should be at least a line "enter onTriggerEnter" been logged on the console when it was called, but strangely nothing gets logged...
I am on Unity 4.5.2. Both the player and Pickup objects have collider and rigidbody component added. What else could be wrong? I am totally confused....
[Update]
Asked question in answers.unity3d.com
[Update]
Question got rejected, because it should be "OnTriggerEnter", not "onTriggerEnter" - needs upper case "O", silly me. Certainly a big lesson learned.
Thursday, 5 March 2015
Unity 5 is here!
Great to hear that Unity 5 is now available for download!
With my current speed of learning, hopefully can have something published before Unity 5.5 is out... ha ha!
Any way, I believe in the 10,000 hour rule, still a long way to go, and I will certainly keep working on it, never give up!
With my current speed of learning, hopefully can have something published before Unity 5.5 is out... ha ha!
Any way, I believe in the 10,000 hour rule, still a long way to go, and I will certainly keep working on it, never give up!
Finished Space Shooter tutorial!
Spent some time following the excellent tutorial of Space Shooter, finally got it completed today. It was great fun creating a shooting game from scratch.
The quality of the tutorial was quite impressive, and certainly helped me to understand Unity a lot more. Strongly recommend anyone interested in Unity to give it a go.
Noticed I actually skipped a few tutorials before the Space Shooter, will certainly try to go through each of them as well. Now, time for the next tutorial...
The quality of the tutorial was quite impressive, and certainly helped me to understand Unity a lot more. Strongly recommend anyone interested in Unity to give it a go.
Noticed I actually skipped a few tutorials before the Space Shooter, will certainly try to go through each of them as well. Now, time for the next tutorial...
Subscribe to:
Posts (Atom)