Weapons and Projectiles

Weapons, the fun devices of destruction found across many Core games! Weapons are a specific type of Core Object that includes features like ammo, reloading, and calculating where a projectile hits.

Types of Weapons

Not everything that can be used as a weapon is actually a Weapon object in Core. In Core Content, the Game Components section has a category called Weapons with a variety of different types of weapons that you can drag and drop into your game.

List of Weapons in Game Components > Weapons

In the Game Components weapon templates, weapons spawning projectiles have the Weapon icon (aim) whereas melee weapons that do damage based on whether or not the weapon hits an object have the Equipment icon (backpack). The melee weapons are not using the Weapon object. They are equipment with abilities that are assigned to the player when the player equips it.

Weapon Properties

All of the available weapons are based upon the same properties. The easiest way to create a new weapon is to start from a default weapon and tweak the properties. In the first section of the properties called Weapon, you will find parameters like Shots / Second for the fire rate or the Animation Stance to define the stance of the player. The damage is set to 0 here because the Advanced weapons are using a more specific way to damage the player, including headshots. To update the damage, open the WeaponDamageShootServer in the Server Context folder.

Properties of the Advanced Assault Rifle
Properties of the WeaponDamageShootServer to change damage

If the “Is Hitscan” option is enabled, no projectiles are spawned and the bullets will instantly hit the other players. If it is disabled, the weapon is shooting Projectiles that can be customized in the Projectile section. The template is a Client Context folder that is spawned with each shot. We are using a Client Context because this is just the visual aspect of the projectile, the settings of the projectile are stored in the Weapon properties. You can update the properties of the Projectile to add gravity if you want bullet drop. You can even set Bounces to 3, which means that the Projectile will bounce three times before disappearing.

Projectile section in the Weapon Properties

Hover the names of the properties with your mouse to look at the tooltip and understand what changing this parameter will do to your projectile.

Creating a new weapon

Let’s say we want to create a weapon that looks like a flower, that throws fireballs that bounces on the ground like Mario (Nintendo). Here are the three steps:

  • Kitbashing the weapon.
  • Creating the projectile.
  • Updating the Weapon properties.

Try it on Core! Follow each step and create this Mario-style gun.

Fireball GIF - Super Mario Bros photo (37768740) - fanpop
Examples of Mario fireball in the various Mario games

Kitbashing the weapon

Most of your game components will have the visual part in a Client Context group to optimize your game. The server does not care how your weapon looks whereas it is really important for the players. In the Geo group inside the Client Context of any weapons, you can find the different parts of the weapon.

Geo group in the Client Context of the Weapon

We can place a flower from the Core Content at the same position, remove the current model, and try to equip the weapon.

The Flower is inside the Geo group

The Weapon is equipped, right-click to aim

Creating the projectile

To create a projectile:

  1. Create a new Create Network Context > New Client Context.
  2. Kitbash your projectile in this folder.
  3. Rename the Client Context.
  4. Create a New Template From This.
Sphere with the Emissive Glow Transparent Material in a Client Context
ClientContext is renamed to Fireball and the template is created

Now that the template of the projectile is created, we can add it to our weapon Properties.

Updating the Weapon properties

To update the projectile of your weapon:

  1. Open the Properties of your weapon.
  2. Drag & drop the new projectile in the Projectile Template property.
  3. Change the Speed, Gravity, and Bounces values to change the behavior of the Projectile.
  4. Press Play and test your new weapon!
Project Properties
The result when shooting with the weapon

Try it on Core! Create your own gun based on a famous video game character and share it to the Community Content. Click here to share your work on the Core Creators Forums

Post a comment

Leave a Comment

Scroll to Top