The Frame you are talking about is PhysicBody, right?
If so, it's because when you change the texture, even though it asks you to resize, it doesn't change the physicsBody, so you would have to recalculate
Post
Replies
Boosts
Views
Activity
In fact, I have a slight impression that perhaps the TileMapNode is configured with a different Tile size than the asset size. Because it seems to me that it's not fitting into the grid
Can you check if the TileMapNode is the right size?
I found this Brazilian YouTube channel that's talk a lot about SpriteKit, maybe it's a good starting point
https://www.youtube.com/watch?v=zoUwIH7g-wY&t=363s
(This video link is a playlist about creating from scratch a game using SpriteKit)
Wow this is so strange...
I’ll suggest you make a few tries, just trial and error.
Try restarting your Mac, sometimes that's enough.
or
Delete and install Xcode again.
If none of this works I can't really think of the reason why it is happening, since I have the same version and it is working.
Hey, I don't know what is doing. Can you explain better?
What is your Xcode version?
Because Xcode 11.5 the SpriteKit temple works pretty well.
There are two things is pass in my mind,
First - you can put the app module on Scene in SKS target
Second - With you have any component attached in your Scene from scene editor, the component need override one property:
override class var supportsSecureCoding: Bool { true }
But I really don't know if any this will help you. Hope this help you.
So I don't understand your question!
the didMove function, is called always when the scene will appear!
So once you go to background and back the didMove will called again, and the AudioSet will added one more time on scene! That is the problem the removeFromParent is not working. In fact is working but the didMove func added the node again!
Hope this help 😎
Yo, I don't know if you can listen in Portuguese but has a great channel talking about SpriteKit, called Behind Game Lab.
the documentation it is awesome to.
Past few years SpriteKit didn't change almost anything, so go ahed and pick up this tutorials!
And try to understand what's going on, the documentation helps a lot in that. Because once you understand what's going on, it's easy to replicate the concepts.
So the way to get node from scene is simple called a func called childNode
let nodeFromScene = childNode(withName: "name of your node")
And there's a better way to add physics to scene bounds, try follow this guide on documentation - https://developer.apple.com/documentation/spritekit/skphysicsbody/creating_an_edge_loop_around_a_scene.
Try just camera position in Y pos, based on player pos + the "offset" you want
Some like this
camera.position.y = player.position.y + 20
This mean 20 pixels ahead from player y pos.
Hope this help 😎
Hey MasterchiefG14, I think the error is in the line 27, where you force an unwrapping trying to cast this " bodyOne.node as! SKSpriteNode"
Try make an if let statement
playerWeaponHitEnemyUnit(playerWeaponAsset: bodyOne.node as! SKSpriteNode, enemyAsset: bodyTwo.node as! SKSpriteNode)
if let spriteBodyOne = bodyOne.node as? SKSpriteNode,
let spriteBodyTwo = bodyTwo.node as? SKSpriteNode {
playerWeaponHitEnemyUnit(playerWeaponAsset: spriteBodyOne, enemyAsset: spriteBodyTwo)
}
Do not force unwrapping, because if it's fail the app will crash.
Hope this resolve 😎