Shards632
1 year agoMHCP Mentor
Weekly Creator Challenge #3: Experienced Creators
Experienced Creator Challenge: Make a 'Better' Interactive Gun!
Challenge Overview
This challenge introduces you to some of the more subtle aspects of making a good interactable object. By completing it, you will have increased experience with making your interactables feel more 'real' and tangible in Horizon Worlds.
You’ll learn how to:
- Add haptic feedback and realistic physics
- Implement ammo tracking and reloading
- Create multiple firing modes with different behaviors
If you are new to player interaction mechanics, check out my Create an Interative Gun! challenge here.
Duration: Mar 10, 2025 - Mar 14, 2025
Estimated Time: Approx. 45 min.
Mentor: Shards632
Rewards:
- Challenge Champion Badge 🏆
- NEW! Challenge Trifecta Badge 🏆🏆🏆 after completing three challenges
Need Help?
- Forum Support: I’ll be actively monitoring this thread during the Challenge duration to help you succeed
- Live AMA: Join my Typescript for HZW on Tuesday, March 11th at 12 PM PST
Challenge Steps:
1. Create Your Foundation
- Create a gun per this week's New Creator Challenge. Given your experience, this should take you significantly less time than 45 minutes.
- Track which hand is holding the gun, and provide haptic feedback in the correct hand when fired.
- Provide 'recoil' to the gun by rotating it backwards around a pivot point centered at the grip when it is fired.
2. Implement Ammo System
- Track ammo remaining in the gun, and display this to the player somehow.
- Provide different audio and haptic feedback when trying to fire when empty.
- Provide a reloading mechanism to top up the ammo, with a sound effect and haptics, and maybe VFX.
3. Add Physics-based Projectiles
- Switch the launching mechanism to fire an actual Entity, like a grenade (find something in the asset library or make something quickly using primitive shapes), rather than using a Projectile Launcher.
- Make the 'grenade' a PhysicsEntity, position it at the gun muzzle, and use applyForce() to launch it.
- Perhaps give it some torque, too, to make it spin?
- Listen for collision events with specifically tagged objects to find out when it collides with them.
- You can also use a short distance raycast in the direction of motion off the front of the projectile to detect when it is about to hit something, rather than using collision events. This allows you to detect pending collisions with any geometry, regardless of tags.
4. Create Mode Switching
- Allow the user to switch between the two firing modes (Projectile Launcher vs Physics Entity) with a button.
- Track ammo separately for the two modes.
- Use different firing sounds and VFX, and different hitting sounds and VFX for the two types of ammo.
Skills You’ll Develop:
- Enhance the realism of your mechanic by adding more 'real world' constraints
- Use haptics to enhance the VR 'feel' of your interactive
- Understand how to launch physics objects and detect collisions with both tagged and untagged entities
What You’ll Need:
- Horizon Worlds Desktop Editor
- Visual Studio Code (configured to work with the Desktop Editor)
- Your Imagination!
Helpful Resources
- All resources from the New Creator Challenge
- Haptics
- Applying Forces and Torque
- Rotation
How to Earn Your Badge
- Build a world with a gun that shoots both projectiles and grenades, with haptic and kickback feedback, ammo counter, and reloading
- Publish your world
- Post to this thread with:
- Your world link
- A screenshot of your avatar holding your gun with a visible ammo meter or shooting a physics object (not projectile)
- Brief feedback on your experience (difficulty level, what you learned, suggestions for future challenges)