I have two functions (to gather movement for left and right) but whenever i try to run them. it says: "ContextActionService: Unexpected error while invoking callback: Unable to cast token to token"
LocalScript:
-- Functions for movement
local function onChoseRight(actionName, inputState)
if UserInputService:IsKeyDown(inputState) then
chosevalue+=1
end
end
local function onChoseLeft(actionName, inputState)
if UserInputService:IsKeyDown(inputState) then
chosevalue-=1
end
end
-- Main Problem:
ContextActionService:BindAction("Left", onChoseLeft, true, "L", Enum.KeyCode.Left)
ContextActionService:BindAction("Right", onChoseRight, true, "R", Enum.KeyCode.Right)

1 comment
Good Job!