local function dash(actionName, InputState)
if actionName == "dash" then
if InputState == Enum.UserInputState.Begin then
local keyPressed = game.UserInputService:GetKeysPressed()
print(keyPressed)
contains(keyPressed, Enum.KeyCode.W)
if contains(keyPressed, Enum.KeyCode.W) == true then
--Instance.new("Part", workspace)
local att0 = Instance.new("Attachment", hrp)
local linearVelocity = Instance.new("LinearVelocity", hrp)
linearVelocity.Attachment = "att0"
end
end
--if contain true
--print input object. keycode
-- if contain == true end holysht thats it
-- -- does order matter
end
end
I want to set att0 as the attachment of linear velocity in script but I seem to be doing it wrong
The problem is that the attachment in the file explorer is not called “att0” that is the name of its variable in the script, as you can see its name is “attachment” that is because you did not give it a name, do this in the script:
No its because I typed “LinearVelocity.Attachment = xxx”, but apparently. its “LinearVelocity.Attachment0 = xxx”. (I forgot the zero). This is the solution
I tried your method but it still didnt work I dont know why. When i do "LinearVelocity.Attachment0 = “att0” " theres an error because it dosent take strings which makes sense. (the engine will really not recognize a string)
But when i do this instead “LinearVelocity.Attachment0 = att0” the engine takes it as a variable why is that so
first error: to refer to the attachment of a linearvelocity you do not say "linearVelocity.Attachment = “att0"”
instead you say:
"linearVelocity.Attachment0 = “att0"”
second mistake: you should not put quotes in the name of the object, because otherwise the game will not take it as an instance, instead of saying "linearVelocity.Attachment0 = “att0"” say “linearVelocity.Attachment0 = att0”
oh wait, trying my own version of the script that also happened to me, when setting a speed in the linear velocity the character played the walking animation, wait while I see why
Theres none, no animation scripts no anything. It just plays the animation i dont really know why it might be automatic (like as in its in the roblox character code itself).
Exactly, I realized that the programming of the default Roblox animations works like this: when the player moves and the hipheight is touching the ground, the running or walking animation is activated, but if it is in the air and moving it does not activate that animation if not the fall animation is activated, to solve this I have already thought of several solutions, let me see which of them can work
But I need to know something, why is this a problem for you? Do you want, for example, to activate a different animation? Something like your own dash animation?