General Usage

Object Pooling RealTime Update – There are some cases in which you won’t see changes in real-time to a bullet’s property/behavior when pooling is enabled. This is because the property/behavior is established when the object is created or is not regularly updated. In these cases, it’s best to remove pooling at least temporarily in order to do real-time testing.

OnCollisionEnter2D vs OnTriggerEnter2D
– VariaBULLET2D’s collision system relies on the OnCollisionEnter2D event method. There are a variety of reasons for this design choice. Using trigger collisions is often considered better for performance (particularly in older versions of Unity), but in some cases does not carry some collision information which might be important (such as the exact point of the collision). You can modify existing references to OnCollisionEnter2D in order to implement an alternative collision detection but in the vast majority of cases this should not be necessary. Additionally, newer versions of Unity have reduced the performance gap between these two different collision methods.

Modifying Prefabs – It’s important to remember that whenever you modify a Shot prefab, it will modify it for all instances in which it is used. For this reason, it is considered best practice to make copies of the prefab and make any changes on those. Note that newer versions of Unity have more robust prefab systems that allow for extension and flexible modification.

Scene View Editing – It’s often helpful to switch to the Scene view tab in order to select emitters, bullets and other gameobjects in order to better isolate them for editing/viewing in the inspector.

Removing Emitters – At some point you might want to simply remove emitters from a given pattern that you’ve constructed. However, by deleting the emitter you will break not only the pattern’s underlying array structure but also likely shift the pattern in an undesirable way. The easiest way to remove an emitter without causing these unwanted effects is to simply disable its enable/disable toggle directly in the inspector.