3.4 KiB
3.4 KiB
LiDAR FPS Game - Setup Guide
Project Structure Created:
- Assets/Scripts/ - Your C# scripts (including FirstPersonController.cs)
- Assets/Models/LidarScans/ - Where you'll import your GLB files
- Assets/Prefabs/ - For reusable game objects
- Assets/Scenes/ - Your game levels
Step 1: Import Your GLB Files
- Open Unity and your OGG project
- Copy some GLB files from
K:\OGG\lidar\toK:\OGG\OGG\Assets\Models\LidarScans\- Start with one or two to test (e.g., "my bedroom.glb" or "studio old.glb")
- Unity will automatically import them
Step 2: Install glTFast Package (for better GLB support)
- In Unity, go to Window → Package Manager
- Click the "+" button in top-left
- Select "Add package by name"
- Enter:
com.atteneder.gltfast - Click Add
Step 3: Create Your Player
- In the Hierarchy, Right-click → Create Empty
- Rename it to "Player"
- With Player selected, click Add Component
- Search for and add: Character Controller
- Add Component again, search for: First Person Controller (our script)
Step 4: Set Up the Camera
- In Hierarchy, Right-click on Player → Camera
- Position the camera:
- Set Position Y to about 1.6 (eye height)
- Reset X and Z to 0
- The FirstPersonController script should automatically find this camera
Step 5: Import a LiDAR Scan into Your Scene
- From Project window, navigate to Assets/Models/LidarScans/
- Drag one of your GLB files into the Scene (Hierarchy)
- Select the imported model in Hierarchy
- In Inspector, click Add Component → Mesh Collider
- This allows the player to walk on it
- You might need to adjust the scale:
- Try Scale: X=1, Y=1, Z=1 first
- If too big/small, adjust all values equally
Step 6: Position Your Player
- Select the Player in Hierarchy
- In the Inspector, set Transform Position:
- Move the player above your scan (Y=2 or Y=3)
- Adjust X and Z to be inside the scan area
- Make sure Character Controller settings are reasonable:
- Radius: 0.5
- Height: 2
- Center: Y=1
Step 7: Test Your Game!
- Click the Play button at the top
- Controls:
- WASD or Arrow Keys - Move
- Mouse - Look around
- Left Shift - Run
- Space - Jump
- Escape - Unlock cursor
Troubleshooting:
Player falls through the floor:
- Make sure your LiDAR model has a Mesh Collider component
- Check that the Mesh Collider is enabled (checkbox ticked)
Can't see anything:
- The camera might be inside geometry - move the Player position up (increase Y value)
- Check that the Camera is a child of Player and positioned at Y=1.6
Movement feels weird:
- Adjust the Character Controller's Radius and Height
- Try different Walk/Run speeds in the FirstPersonController settings
GLB files won't import:
- Install the glTFast package (see Step 2)
- Alternatively, you can convert GLB to OBJ using Blender if needed
Next Steps:
Once you have basic movement working, we can add:
- Crosshair UI
- Health system
- Shooting mechanics
- Enemies/targets
- Multiple level loading
- Lighting improvements for your LiDAR scans
Tips for LiDAR Scans:
- Your scans might be very detailed - this can slow down the game
- You may need to optimize them later (reduce polygon count)
- Start with smaller scans (single rooms) before loading larger areas
- You can have multiple scans in one scene to create larger levels