I’m trying to make a combat system right now but I’m fairly new to making one. Right now I wanna make a dash system but I don’t wanna steal or copy any code. The point of making this game is mostly for me to learn, and copying another script wouldn’t really help me learn much.
The way I want the dash system is basically a simple button use would activate it. It has 4 directions, forward, left, right and backwards. I want the directions to be relative to the players camera, so even if the character is looking to the right, if the player is holding W and presses dash, the character wont go forward to where its looking, but where to the camera is.
What I want is someone to tell me what I should use and how I should get started with creating the dash system. Any examples so I can understand the things I should use would be really helpful. I wanna understand and learn more than I wanna create this script, so even if I fail to create it, I’d love to learn a thing or two.
There must be 500 questions like this, answered here. Research is the key. You also need to provide scripts that we can help you perfect. We’re not here to write scripts for you. “I don’t want to steal or copy any code.” Shared code is not stealing. Consider it shareware…
Well I dont want someone to write a script for me, as I said I want someone to tell me what things I should use to get started. I tried searching on the forum and found some stuff but the thing is that those people already knew stuff about the API and etc. So I don’t really understand those posts and I couldn’t really find anything that would help me. But i’ll do some more research then I guess. Thanks!
I tried to tell you how to get started… Don’t mean to sound rude, I’d love to help you out with a script… This would be a good start.
Step 1: Create a dash animation. One animation for each direction.
Create an Animation Event for when the dash movement begins.
Step 2: Create a local script parented to StarterPlayer.StarterCharacterScripts.
Create 4 Animation objects as children of the script, and paste in the published animations.
Write code to do the following in the local script:
local Char = script.Parent -- all scripts in StarterPlayerScripts are cloned into the character when it spawns
-- get Humanoid and Humanoid.Animator and HumanoidRootPart
-- load animation tracks for each animation Animator:LoadAnimation(animation)
-- get and connect to the animation events using GetMarkerReachSignal
-- when signal is fired, move the character
-- to know when to play the animation, do
local UIS = game:GetService("UserInputService")
-- connect to InputBegan and detect the inputs you want for the dash and then play the animation
-- alternatively you can use ContextActionService instead of UserInputService