Game Development Reference
In-Depth Information
Finally, rename the new prefab to
MapPoint
so that we know what the prefab is for in
our folder structure.
Note
With a collider set as a trigger, it will cause the
OnTrigger
functions (
OnTriggerEn-
ter2D
and
OnTriggerExit2D
) to be called in scripts as opposed to the normal
OnCollision
functions (
OnCollisionEnter2D
and
OnCollisionExit2D
).
Bear this in mind when applying scripts that rely on a collider. We will update our
Nav-
igationPrompt
script accordingly.
With the prefab created, just drag it to the project's
Assets
window in
As-
sets\Prefabs\Environment
. You will get a new
Prefab
asset for a map's place
of interest, as shown in the following screenshot: