Log In  


Hello! I was wondering if anybody can help me figure out why my code wont delete an object. This is my first time using del so I'm sorry if it is really obvious.

trigger:

function update_slash_p1()

for s in all(slash_p1) do
s.dx+=1

if s.dx>8
then
kill_slash_p1()
end
end

code:

function kill_slash_p1()

del(slash_p1,
dx,
frame,
flip,
damage
)

end

I also tried:

del(slash_p1,{
dx,
frame,
flip,
damage
})
end

Thank you!



Honestly, I wouldn't bother with the kill function (unless it does something else not shown here). I'd just do:

if s.dx > 8 then
  del(slash_p1,s)
end

Thankyou, I will try that


It did work, thanks!



[Please log in to post a comment]