0

I'm making a a project that has to use swift playground (.swiftpm); It uses swiftUI for some elements but the main is on a SpriteKit Scene. My problem is that I want to use a particle and it just can't find it.

func moveSubmarine(newPosition : Float){
    if let bubble = SKEmitterNode(fileNamed: "Bubbles.sks") {
        submarine.addChild(bubble)
    }
    else{
        print("No particle found")
    }
    checkDepthForEvent(newPosition)
}

This is where I call it. And here is my project treeenter image description here

2
  • "I`ve tried everything". Edit your question with what you tried so people don't suggest things you already tried. Commented Jan 29, 2024 at 22:52
  • The .sks file must be in the Resources folder of the app bundle to locate the file correctly. In the Mac version of Swift Playgrounds, adding a .sks file to the playground creates a Resources folder for the playground and places the .sks file in the folder. I'm not sure what you have to do to add a Resources folder in the iPad version of Swift Playgrounds. Commented Jan 31, 2024 at 22:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.