how to finish a level with a Collectible item

i followed the tutorial on " Collectible items" but am stuck i want to expand on it and make it so when i collect that item it goes into a new level [import]uid: 29011 topic_id: 19422 reply_id: 319422[/import]

You would most likely want to set up your game using something like Director or Storyboard and then when detecting the collision with the item you will want to change scenes. [import]uid: 5833 topic_id: 19422 reply_id: 74975[/import]

i am using directer

this is the code for the collectible item

if event.other.IsPickup then
local item = event.other
local onTransitionEnd = function(event)
event:removeSelf()
end
– fade out the item
transition.to(item, {time = 500, alpha = 0, onComplete=onTransitionEnd})
if item.pickupType == “score” then
director:changeScene (“level9”)
end
end

i followed the tutorial and changed the code by adding the “director.changeScene(“level9”)” I’m new to this and level9 and pointing it to the level9.lua which loads up the map [import]uid: 29011 topic_id: 19422 reply_id: 74980[/import]

Is that giving you an error? [import]uid: 5833 topic_id: 19422 reply_id: 74982[/import]

ya its not switching to the new level. is that how the code it supposed to be? or am i missing a few things from it [import]uid: 29011 topic_id: 19422 reply_id: 74987[/import]

I mean is there an actual error printed to the console/terminal ?

It’s hard to know what could be missing with such a small snippet of the code. [import]uid: 5833 topic_id: 19422 reply_id: 75082[/import]