How recreate this?

How do i recreate this?
https://gyazo.com/993e9ac0d5168897d25da97957c4fa15

How is that possible, i have a anim setup, and a simple fast made gun that i made in 2 minutes
this is the hiarchy btw:
image

this is my current local script:

local gun = script.Parent

local uis = game:GetService("UserInputService")

local char = game.Players.LocalPlayer.Character
local hum = char:FindFirstChildWhichIsA("Humanoid")

local Animator = hum:WaitForChild("Animator")

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://15590863279"

local AnimationTrack = Animator:LoadAnimation(Animation)

uis.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.R then
		AnimationTrack:Play()
	end
end)
2 Likes

You’d want to create a model of the gun and attach it to the right hand in a view model. The system should have different animation states (such as idle, shooting, reloading, etc.).

I’d go about achieving such a system in this order:

  • Define a table to store data about the gun model, including the parts you want to animate (e.g., the gun itself, or the arms).

  • Write functions to handle different animations. You might have functions like shootAnimation, reloadAnimation which would use a function like animateWeapon(weaponData, animationSequence) where the animationSequence is the name of the specific index containing the animation in order. Below this description is a list of variables you may include in each frame of your animation tables to make this process easier.

    • The part entry in your animation would represent the part of the character model that you’d want to animate, such as the specific arms or pieces of the gun.

    • The c0 entry would specify the starting CFrame of the part. If this is provided, it would set the initial position of the part.

    • The c1 entry would specify the ending CFrame of the part. If this is provided, it would set the final position of the part.

    • The transitionDuration entry would tell you the duration of this animation frame in seconds (or any other unit you’re comfortable with) and may use a default duration. This value would determine how long it takes for the animation to transition from the initial position (c0) to the final position (c1).

    • The transitionStyle could behave like the Enum.EasingStyle table and allow for you to provide motion curves for transitioning between c0 and c1. I’d go with a string representation for the equation that would be pre-defined in another array like transitionStyles containing entries like “linear” and “smooth”, or an entry with specific parameters for a custom equation.

    • The rotationPivotOffset entry in the animation frame specifies the offset of the pivot point around which the rotation occurs. It’s a Vector3 representing the local position of the pivot relative to the part. If not provided, it may use a default pivot.

    • The shouldCloneDuringAnimation entry, if provided, instructs the system to clone the specified part during the animation. This can be useful for effects like creating temporary duplicates for certain visual effects.

    • The partTransparency entry sets the transparency of the part. This is useful for creating effects like fading in/out or making parts temporarily invisible.

    • The shouldPlaySound entry, if set to true, indicates that a sound effect should be played during the animation. Additional sound-related variables, such as soundId, volume (soundVolume), pitch (soundPitch), timePosition (soundTimePosition), head (whether the sound is attached to the player’s head), and delay (soundDelay before stopping the sound), can be included.

    • The shouldDropDuringAnimation entry, if set to true, may indicate that the part should be dropped or fall. This could be relevant for specific animations, such as dropping a magazine.

    • The shouldDeleteAfterAnimation entry, if set to true, indicates that the part should be deleted after the animation. This might be used for cleaning up temporary parts or effects.

Because most people don’t know where to begin with first-person shooters, I provided this explanation to help them understand.


That’s the long explanation I’ve been working on. If you want to keep things simple, you can use the Animation Editor, but I usually work with FPS games in mind.

yeah thanks, i will look into this later

Okay, now with the second response. You don’t really have to go with everything that I’ve first mentioned if you don’t want to. There’s always another way to go about this.

  • You can also use KeyframeReached if you just want to weld the magazine to the hand after a specific keyframe and then add a new magazine to place on the gun again after the signal is fired again.

There’s a lot I could go about with explaining an animation system for weapons but I really love having full control with the first suggestion I’ve made.

2 Likes

Whats the most simple way, because i think thats gonna take hours.

My knowledge is very limited, can u explain in simpler terms?

1 Like

Unfortunately this is how developing goes :sweat_smile:
Developing is not easy, and it takes experience, knowledge, and patience.

I highly suggest you learn more on scripting through tutorials and looking through the documentation to learn what you need to know. It may sound tedious, but it is so worth it.

Okay i understand, thanks i thought maybe there was a better understanding for a rookie

I was also like you before, I wanted to recreate a first person gun system but it didn’t work out. Now I’ve been doing some other stuff to get experience and learn more scripting.

Yeah same but i thought jumping from easy tweens and just general testing to whole gun systems was a good idea, it isnt. Building experience is

Use this tutorial

1 Like

I made this: https://gyazo.com/22b69ac72d210a40ce67626d0aee7f67
I never make anims so thats why it doesnt look perfect, but i made that anim rq and it doesnt work. Followed every step in the post :confused:
Cant even pick the tool up