Jump to content

How to make a prefab "attackable"


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?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...