Roblox Raycast Tutorial: How To Make Floating Pickups Over Uneven Terrain

Опубликовано: 17 Декабрь 2020
на канале: Marcel Gagné
848
18

I wanted to place coins, health pickups, or some other form of token, on uneven, randomly generated surface terrain for a game I was working on in Roblox Studio. Now, if you are using a flat surface, like the default baseplate, the health tokens would float nicely at 4 studs above the surface (or 2 or 6), but with hills, lakes, valleys, etc, they could be inside a mountain or floating 30 feet in the air. How can you, as a game designer, determine the actual position above ground when the ground isn’t flat? The answer is raycasting. In this video, I'll show you how that works for generating those pickups.