Jump to content

Recommended Posts

I am doing the creature mod tutorial and am trying to figure out how to make it so I can attack the creature.  I looked through multiple prefabs that you can attack and the things they all have in common that has to do with combat is

inst:AddComponent("combat")
inst:AddComponent("health")
inst:ListenForEvent("attacked", OnAttacked)
local function OnAttacked(inst, data)
....
end

I added each of those to my prefab(in the correct place) and I can't attack the creature when i left click it.  What am i missing?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...