ios - PhysicsBody larger than Texture it is assigned to (pictures) -


i have been having issue 1 of sprites "physicsbody" property.

i have placed physicsbody node "barn", directly on top of non-physicsbody node "mound" without issue. looks fine on simulator, node "hero" keeps bumping invisible barrier, no longer poses problem when remove "barn" (so must issue "barn"). physicsbody element of barn seems extending down y farther actual texture is. i.e. physicsbody , texture seem in 2 different places, despite fact parameters of physicsbody consist of texture:

let barn = skspritenode(texture: barn.texture, size: barn.size) barn.physicsbody?.dynamic = false barn.physicsbody?.pinned = true barn.physicsbody?.affectedbygravity = false  barn.position = cgpointmake(cgrectgetmidx(self.frame), cgrectgetminy + mound.size.height / 2) 

as can see in following picture, when apply impulse "hero" node (the black circle sitting on top of tan bar on bottom) gets stopped kind of invisible node:

http://imgur.com/gallery/atb6jgf/new

if continue apply impulse goes node, following same kind of shape pattern, if dropped maybe 50 pixels:

http://imgur.com/gallery/rpyf3dk/new

if add 150 pixel space y-value so:

barn.position = cgpointmake(cgrectgetmidx(self.frame), cgrectgetminy(self.frame) + mound.size.height / 2 + 150) 

then "hero" node can move should:

http://imgur.com/rbkarss

so can deduce physicsbody seems way down y-axis despite texture being placed on top of mound. new swift, can make sense of this? thanks.

for else having issue this, found problem in anchorpoint.

anchorpoint works node , not " physicsbody ".


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -