#How to make a gun with custom animations

137 messages · Page 1 of 1 (latest)

graceful heath
#

raycasts arent visible

dry dew
#

if you want the bullets to be visible, create a new thread

and for the custom animations, you can search it on google

midnight sparrow
midnight sparrow
dry dew
#

are you trying to make an animstion or play it?

#

if it is to make, #1006356488912121967

#

if it is to play then tell

midnight sparrow
midnight sparrow
#

i have the model

midnight sparrow
midnight sparrow
graceful heath
#

unless u want it to shoot through the walls

midnight sparrow
graceful heath
#

tell me friend

#

what do u think a raycast it

#

is*

midnight sparrow
#

a raycast is basically a laser, you can choose how far it goes, you need to decide it's position and orientation, a raycast can be used for many actions, for example killing players when they touch the raycast, or change the color of a part when it touched the raycast

midnight sparrow
#

thats literally what a raycast is

graceful heath
#

u think its visible?

#

hahaha

midnight sparrow
#

no, its not visible

#

never mentioned its visible

graceful heath
#

so u want a gun

#

that doesnt raycast

midnight sparrow
#

take for example the WB kit, when you search it on the toolbox, theres many guns there, that dont use raycasts

graceful heath
#

and it shoots through walls

midnight sparrow
#

no i dont want it to shoot through the walls

graceful heath
#

then raycast it

midnight sparrow
#

dude

graceful heath
midnight sparrow
#

you can make the part remove when it touches another part

graceful heath
#

cheapskate way also

midnight sparrow
#

how is it cheapskate way

#

its the normal way, the easy way

#

everybody wants to go the easy way

graceful heath
#

exactly

midnight sparrow
graceful heath
#

how you gonna get an advanced gun system going the easy way

midnight sparrow
#

it still works

#

it does what i need

#

i need a system similar to that

#

but without the zooming in

graceful heath
#

im out

midnight sparrow
# graceful heath im out

aight, seems like you just cant understand what i want and cant help me, if you cant help me then why did you come here in the first place

graceful heath
#

think about it

midnight sparrow
#

think about what? i dont want the bullets to instantly reach the target no matter how far it is, all good games DONT use raycasts for guns

graceful heath
#

use both

midnight sparrow
#

wdym use both

graceful heath
#

wait

#

technically

midnight sparrow
#

basically

#

lemme try and explain a bit more

graceful heath
#

bullets travel faster then the speed of light

midnight sparrow
#

when you shoot, the gun creates a part

graceful heath
#

so

#

it would be realistic

midnight sparrow
graceful heath
#

no?

midnight sparrow
#

dude

#

an average bullet travels at 0.9 mach speed

#

1 mach speed is 1 times the speed of sound

#

nothing is faster than the speed of light

#

if something reaches the speed of light, that object will turn into energy and not be physical anymore

#

so no, it would not be realistic

graceful heath
#

"When bullets fly through the air, they do so at amazing speeds. The fastest bullets travel more than 2,600 feet per second. That's equivalent to over 1,800 miles per hour. To put that in perspective, it's amazing to realize that bullets travel over twice the speed of sound!"

midnight sparrow
#

"twice the speed of sound"

#

2 mach speed, not as fast as the speed of light

graceful heath
#

i meant sound

midnight sparrow
#

yeah, it does travel faster than sound

#

but, MOST bullets travel at 0.9 or 0.95 mach speed

graceful heath
#

making it almost instantly

midnight sparrow
#

pistols from assault riffler (like the AK-47) travel at about 2 mach speed

#

sniper riffle bullets travel at about 3 mach speed

#

machinegun bullets (like the minigun or railgun) travel at 4 mach speed

#

but most pistol bullets (9mm) travel at 0.1 mach speed

wheat nymph
#

studio** You are now Level 6! **studio

midnight sparrow
#

102 miles per hour

midnight sparrow
#

and 1 stud is 0.25 meters

#

meaning 1 meter would be 4 studs

#

1km would be 4000 studs

#

0.1 mach speed is 163 km per hour

#

meaning it would travel at 652000 studs per hour

#

and 10k studs per minute

#

1.5 studs per second

#

1.5K*

#

btw my math is:
4000*163 = 652000
652000/60 = 10k
10k/60 = 1.6k

midnight sparrow
#

so, basically how the gun would work is

#

when you click it plays the shooting animation

#

it duplicates a part inside the serverstorage that has a scipt to delete itself once it touches something and if that something is a player it deals damage

midnight sparrow
midnight sparrow
#

cuz not realistic

#

and plus you cant see it

dry dew
midnight sparrow
#

no i mean like, see the bullet actually moving

dry dew
#

and a muzzle flash on the gun

dry dew
#

and since its slow

#

it wouldnt cover a lot of distance

#

making it fall

#

you have to give it a high velocity

midnight sparrow
#

dude

dry dew
#

but when you give it a high velocity

#

it becomes hard to see

midnight sparrow
#

but you can still see it

dry dew
#

making it like a raycast but more harder steps

midnight sparrow
#

the making bullet part is quite easy

#

i care about the playing animation part

dry dew
midnight sparrow
#

dude

#

not raycasts

#

no

dry dew
#

and then play the loaded animation using AnimationTrack:Play()

midnight sparrow
#

ok but how do i make the idle animation

dry dew
#

Animator is usually inside the HUmanoid

midnight sparrow
#

and running animation and all that shit

dry dew
dry dew
midnight sparrow
#

"how to make a gun with custom animations"

dry dew
#

im pretty sure everyone would think it means a gun animation

midnight sparrow
#

nobody would think that

dry dew
#

you should specify which type of animation it is

midnight sparrow
#

omfg just leave it

#

idfc anymore

#

ffs

dry dew
#

k

graceful heath
#

example:

#
local anim = script.Animation
local humanoid = player.Character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local animation = animator:LoadAnimation(anim)

animation:Play()```