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.
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.
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.
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.
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.
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.
We can place a flower from the Core Content at the same position, remove the current model, and try to equip the weapon.
Creating the projectile
To create a projectile:
Create a new Create Network Context > New Client Context.
Kitbash your projectile in this folder.
Rename the Client Context.
Create a New Template From This.
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:
Open the Properties of your weapon.
Drag & drop the new projectile in the Projectile Template property.
Change the Speed, Gravity, and Bounces values to change the behavior of the Projectile.
Strictly Necessary Cookies
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
3rd Party Cookies
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!