# Chapter 9 catBodyTexture

**URL:** <https://forums.kodeco.com/t/chapter-9-catbodytexture/105447>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [April 15, 2020, 9:18am UTC](https://forums.kodeco.com/t/chapter-9-catbodytexture/105447 "2020-04-15T09:18:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iraisethebar](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/iraisethebar/32/81494_2.png) [@iraisethebar](https://forums.kodeco.com/u/iraisethebar)\
**Post date:** [April 15, 2020, 9:18am UTC](https://forums.kodeco.com/t/chapter-9-catbodytexture/105447/1 "2020-04-15T09:18:12Z")

</div>

Hey guys!

I’m following the tutorial to get the catNode’s physicsBody to match the SKtexture(imageNamed: “cat\_body\_outline”. But instead of showing the image texture, it’s just a regular square.

let catBodyTexture = SKTexture(imageNamed: “cat\_body\_outline”)  
parent!.physicsBody = SKPhysicsBody(texture: catBodyTexture,  
size: catBodyTexture.size())

I’ve taken a look at the final project, provided with the books resources, but there it also shows as a square. Anyone know how to fix this?

---

<div class="post-metadata">

**Author:** ![mokhet](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/mokhet/32/102075_2.png) [@mokhet](https://forums.kodeco.com/u/mokhet)\
**Post date:** [May 28, 2020, 11:41am UTC](https://forums.kodeco.com/t/chapter-9-catbodytexture/105447/2 "2020-05-28T11:41:28Z")

</div>

I think it is a bug in some simulators

I have the same issue when building with iOS 13.5, targetting a simulator iPhone XS with iOS 13.5  
However, it is working as expected when I build the same code targeting my real device iPhone XS also with iOS 13.5  
And it is also working as expected in simulator when I build iOS 12.0 targeting a simulator iPad Air 2 with iOS 12.1

I end up using SKPhysicsBody(plogygonFrom:)

```auto
import SpriteKit

class CatNode: SKSpriteNode, EventListenerNode {

func didMoveToScene()
{
 // 2020-05-28 12:03:13.442486+0200 Cat nap[2376:114822] PhysicsBody: Could not create physics body.
 // let texture = SKTexture(imageNamed: "cat_body_outline")
 // parent!.physicsBody = SKPhysicsBody(texture: texture, size:texture.size())

 let path = CGMutablePath();
 path.move(to: CGPoint(x:-77.0, y:-198.0))
 path.addLine(to: CGPoint(x:-87.0, y:-129.0))
 path.addLine(to: CGPoint(x:-14.0, y:-18.0))
 path.addLine(to: CGPoint(x:-82.0, y:67.0))
 path.addLine(to: CGPoint(x:-13.0, y:179.0))
 path.addLine(to: CGPoint(x:85.0, y:177.0))
 path.addLine(to: CGPoint(x:169.0, y:81.0))
 path.addLine(to: CGPoint(x:99.0, y:3.0))
 path.addLine(to: CGPoint(x:137.0, y:-127.0))
 path.addLine(to: CGPoint(x:117.0, y:-198.0))

 parent!.physicsBody = SKPhysicsBody(polygonFrom: path)
}

}

```

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [July 4, 2020, 5:45pm UTC](https://forums.kodeco.com/t/chapter-9-catbodytexture/105447/3 "2020-07-04T17:45:03Z")

</div>

@mokhet Thank you for sharing your solution - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [September 29, 2020, 1:18am UTC](https://forums.kodeco.com/t/chapter-9-catbodytexture/105447/4 "2020-09-29T01:18:13Z")

</div>

This topic was automatically closed after 166 days. New replies are no longer allowed.
