Try putting a very large, silent and invisible button just in front of the cave-in and linking it to a script entity. I haven't looked at buttons much, but Neikun might be able to help you there.Fhizban wrote:Thanks Neikun!
Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
I have a solution for this I'm currently using in a dungeon about to be entered into Editing Challenge II.Fhizban wrote:Is there also a invisible object i can place to make a message appear when the player clicks on something? Like a cave-in the player can click on and then it displays a message.
Code: Select all
cloneObject{
name = "invisible_item",
baseObject = "rock",
model = "assets/models/env/gobelin.fbx",
}
Code: Select all
defineObject{
name = "speech_alcove",
class = "Alcove",
anchorPos = vec(0, 0.5, -0.01),
anchorRotation = vec(0, 180, 0),
targetPos = vec(0, 0.5, -0.01),
targetSize = vec(0, 0, 0),
placement = "wall",
replacesWall = false,
editorIcon = 96,
}
Code: Select all
function speechOn()
speech_alcove_1:addItem(spawn("invisible_item"))
end
function speechOff()
local temp = speech_alcove_1:containedItems()
temp():destroy()
end
Code: Select all
onPickUpItem = function(party, item)
if item.name == "invisible_item" then
speech:talk()
return false
end
end,