Hi all.
I want to change the sound of the pushable_block to my custom sound. So no matter what direction it's clicked on I need it to play my sound.
Code: Select all
defineObject{
name = "pushable_block",
baseObject = "base_floor_decoration",
components = {
{
class = "Model",
model = "assets/models/env/pushable_block_01.fbx",
},
{
class = "ProjectileCollider",
},
{
class = "Obstacle",
hitSound = "$weapon",
},
{
class = "DynamicObstacle",
},
{
class = "PushableBlock",
},
{
class = "Clickable",
name = "clickNorth",
offset = vec(0, 1.15, 1.2),
size = vec(1.2, 1.2, 0.1),
maxDistance = 1,
--debugDraw = true,
onClick = function(self)
if party.facing == (self.go.facing+2) % 4 then
self.go.pushableblock:push(party.facing)
end
end,
},
{
class = "Clickable",
name = "clickEast",
offset = vec(1.2, 1.15, 0),
size = vec(0.1, 1.2, 1.2),
maxDistance = 1,
--debugDraw = true,
onClick = function(self)
if party.facing == (self.go.facing+3) % 4 then
self.go.pushableblock:push(party.facing)
end
end,
},
{
class = "Clickable",
name = "clickSouth",
offset = vec(0, 1.15, -1.2),
size = vec(1.2, 1.2, 0.1),
maxDistance = 1,
--debugDraw = true,
onClick = function(self)
if party.facing == self.go.facing then
self.go.pushableblock:push(party.facing)
end
end,
},
{
class = "Clickable",
name = "clickWest",
offset = vec(-1.2, 1.15, 0),
size = vec(0.1, 1.2, 1.2),
maxDistance = 1,
--debugDraw = true,
onClick = function(self)
if party.facing == (self.go.facing+1) % 4 then
self.go.pushableblock:push(party.facing)
end
end,
},
{
class = "Light",
name = "lightNorth",
offset = vec(0,1.2,1.2),
range = 1.2,
color = vec(5,2,2,0.3),
brightness = 2,
fadeOut = 0,
fillLight = true,
},
{
class = "Light",
name = "lightEast",
offset = vec(1.2,1.2,0),
range = 1.2,
color = vec(5,2,2,0.3),
brightness = 2,
fadeOut = 0,
fillLight = true,
},
{
class = "Light",
name = "lightSouth",
offset = vec(0,1.2,-1.2),
range = 1.2,
color = vec(5,2,2,0.3),
brightness = 2,
fadeOut = 0,
fillLight = true,
},
{
class = "Light",
name = "lightWest",
offset = vec(-1.2,1.2,0),
range = 1.2,
color = vec(5,2,2,0.3),
brightness = 2,
fadeOut = 0,
fillLight = true,
},
{
class = "Sound",
sound = "silent", [color=#FF8000]----------This wont work-------------[/color]
offset = vec(0, 1.5, 0),
enabled = false,
},
},
editorIcon = 220,
}