Journal Entry 3


Date: 11.3.2024

Activity: 

- Went throught all steps in both documents of scripting tutorials

- Built the game with finished shooting mechanics

Notes:

The provided tutorials very helpful, clear and easy to follow. Even then I've encountered various small issues while going through them.

First was a warning when applying Bullet material to the bullet prefab. But everything seemed to work properly even with this warning so I left it there:


Next I struggled a bit when trying to set a different bullet variant. I was trying to call the method directly on bulletSpawned (as the tutorial instructed) which didn't work, but all I needed to do was get the BulletController component. I also had a different issue with this method - in it I was altering the speed of the bullet. But a default speed was also being set in the Start method which (as I found out) runs only after it. My temporary fix was to comment out the speed change in Start and everything worked.

My last issue was an error "Object reference not set to an instance of an object" when trying to break the column into parts. I've managed to fix this by having columnParts be a GameObject type and then getting the right component with the Break method. But the solution provided in the tutorial was using the component type for columnParts and the getting gameObject to call SetActive method which didn't work for me (see error above).

This tutorial definitely helped me understand how objects in Unity interact with scripting and what is relatively simple to do (which was useful for my Project A).

Invested hours: 

Scripting HW: 3.5 hours

Outcome:

Uploaded build of the modified game with my own shooting script to itch.io.

Files

2DPlatformerScripting.zip 82 MB
Mar 11, 2024

Get Project T

Leave a comment

Log in with itch.io to leave a comment.