What on earth does ContextActionService:BindActivate() do?

So yea, the title pretty much sums up my question; What exactly does ContextActionService:BindActivate() do?

I’ve tried reading the API documentation for this particular function, but to be honest I’m still left confused. If anyone understands what this function does, an explanation would be greatly appreciated thanks.

1 Like

In short, ContextActionService:BindActivate() just gives you another way of activating:

  • ClickDetector.MouseClick
  • Tool.Equipped (if Tool.ManualActivationOnly is false)
  • Tool.Activated (if Tool.ManualActivationOnly is false)

Basically it fires these 3 with the keys on the device you assigned.

Example:

-- Local script
game:GetService("ContextActionService"):BindActivate(Enum.UserInputType.Keyboard, Enum.KeyCode.E)
-- Click detector script 
script.Parent.ClickDetector.MouseClick:Connect(function()
	print("clicked")
end)

This would make it so that when you press E while hovering on the part, it would still work.

Explorer layout:
image

Lastly, you should post this in #help-and-feedback:scripting-support instead.

2 Likes

thank you for that. alot more easier for me to interpret. Although, what if I had more than one ClickDetector or Tool? Would :BindActivate() fire for all those Instances?

Yes it’d fire for all of these Instances

1 Like

aight, thanks for clearing that up.