Placing an object in the world
In our AR game, we'll spawn an object in the world whenever we tap the screen. This section will create the object to spawn a friendly (albeit spiky) turtle:
- Drag
TurtleShellPBRfrom theAssets/RPG Monster Duo PBR Polyart/Prefabsfolder into the Hierarchy (or directly to the Scene panel) to add the Prefab to the current scene:Figure 13.18 – Adding the turtle Prefab to the scene
- Position it at point
0, 0, 0. - Scale the turtle to
0.1, 0.1, 0.1so it doesn't take over your living room. - Rename it
Turtle.
You'll quickly notice that it doesn't look quite right on account of it being completely pink. This shade of pink may be familiar to you if you've ever used a broken shader (or broken one yourself – I know I have!) or have forgotten to apply a material to a mesh. In this case, the issue is down to the material not being compliant with the URP. Luckily, we can fix this easily:
- In the...