cancel
Showing results for 
Search instead for 
Did you mean: 

Weekly Creator Challenge #3: Experienced Creators

Shards632
Mentor

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:

Helpful Resources

How to Earn Your Badge

  1. Build a world with a gun that shoots both projectiles and grenades, with haptic and kickback feedback, ammo counter, and reloading
  2. Publish your world
  3. 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)

 

Upcoming Events:
Office hours - AMA:TypeScript for MHW Tuesday 3/11 at 12:00 PM PT - Register
Build with a Mentor: Laser Pen for Mobile Thursday 3/27 at 5:00 PM PT - Register

March calendar of all Mentor Workshops and Office Hours
5 REPLIES 5

EV1LSM1RK
Partner

1000000983.jpg

https://horizon.meta.com/world/2582785771911348

I Created an AK/RPG DUO. I would say this is an intermediate to advanced difficulty. I had Fun making it, a few things I learned was how much I could use multiple number variables to track and activate different actions; then what I did on my previous versions of similar mechanics. My suggestion to all Creators is to push them self to learn; to boost their creativity and knowledge further.

EV1LSM1RK

I like it! The RPG destruction of the cars is especially epic. The automatic rifle fire hit effect is nice, too. Also, like how you prevented griefing by only allowing reload using your _own_ ammunition rather than stealing it from other.
Two comments:

- it does not really work, at all, on XS.  Loading the gun is extremely awkward w/o two hands, and aiming does not seem to work right. Could not hit anything.

- The haptics are played on both hands when firing, even when held in only one hand. I did notice that it had two handed barrel hold grip points, tho!.

Upcoming Events:
Office hours - AMA:TypeScript for MHW Tuesday 3/11 at 12:00 PM PT - Register
Build with a Mentor: Laser Pen for Mobile Thursday 3/27 at 5:00 PM PT - Register

March calendar of all Mentor Workshops and Office Hours

Tabz87
Member

 

 

https://horizon.meta.com/world/637382515890782

One gun uses Codeblocks, and the other uses Typescript. I'm still in the beginning of learning typescript,  but I was able to use waffles tool for help. I realized after publishing,  I didn't add the spin on the grenade as planned.  I also had trouble trying to make this post yesterday.

My creation is probably intermediate, and I learned more about: Typescript,  using the VFX and SFX at the hit point, and switching between projectile mode and physics weapon mode.

1000013028.png

 

Nice!  What was your experience between doing this in TS and codeblocks? Did you find the TS harder/easier? Good sound effects for loading and firing. Nice atmospheric demo world!

I noticed a few things playing on web (did not try on VR yet):

  • There's non vfx for firing laser or grenade
  • There's no vfx or sound when the laser or grenade hit a target
  • The aiming of the laser seems 'off' for XS users,  it's kind of pointed at the ground.
  • The grenade and ammo seem to use the same 'ammo' counter.
Upcoming Events:
Office hours - AMA:TypeScript for MHW Tuesday 3/11 at 12:00 PM PT - Register
Build with a Mentor: Laser Pen for Mobile Thursday 3/27 at 5:00 PM PT - Register

March calendar of all Mentor Workshops and Office Hours

Tabz87
Member

Thank you for the great feedback! I do think I should have tried to prepare it better for web, at least to make sure things work properly. I still struggle a bit with the TS, I found it a bit harder, because I am still new to it. I am taking time every day to focus on learning more.