# round object rotate but not its image

**URL:** <https://forums.solar2d.com/t/round-object-rotate-but-not-its-image/150137>\
**Category:** Physics\
**Created:** [October 4, 2019, 8:28pm UTC](https://forums.solar2d.com/t/round-object-rotate-but-not-its-image/150137 "2019-10-04T20:28:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manu\_1010](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/m/839c29/32.png) [@manu\_1010](https://forums.solar2d.com/u/manu_1010)\
**Post date:** [October 4, 2019, 8:28pm UTC](https://forums.solar2d.com/t/round-object-rotate-but-not-its-image/150137/1 "2019-10-04T20:28:56Z")

</div>

Hello everyone, i’m creating a simple game but i’m having a problem, I have wrote this code as an example of what i want to do:&nbsp;

```
physics = require ("physics") physics.start( ) ball = display.newImageRect("Ball.png", 15, 15, {x=0,y=0}) physics.addBody(ball, 'dynamic' , {radius=7.5,bounce=0.8}) local downhill = display.newRect( 130, 130, 1500, 150 ) physics.addBody( downhill,"static" ) downhill.rotation = 2

```

In this code a ball goes downhill and you can see it going down but the image doesn’t rotate, to get the effect of rotating i must put:&nbsp;

```
ball:applyAngularImpulse( 0.01 )

```

How can i get the same effect without doing that? I’m making a game where you basically launch a ball to break some brick and can’t make the ball image rotate. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![XeduR](https://forums.solar2d.com/user_avatar/forums.solar2d.com/xedur/32/256_2.png) [@XeduR](https://forums.solar2d.com/u/XeduR)\
**Post date:** [October 4, 2019, 9:43pm UTC](https://forums.solar2d.com/t/round-object-rotate-but-not-its-image/150137/2 "2019-10-04T21:43:01Z")

</div>

You need to give the ball a friction value that isn’t 0. With 0 friction, it simply glides. Giving it a friction of even 0.01 will force it to rotate.

Also, when you are creating the imageRect, if you want to give the object specific x and y coordinates, you need to do so via other means, e.g.

```
ball.x, ball.y = 20, 40

```

That table you’ve added at the end of your newImageRect function doesn’t do anything and it is just ignored by the function.

---

<div class="post-metadata">

**Author:** ![manu\_1010](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/m/839c29/32.png) [@manu\_1010](https://forums.solar2d.com/u/manu_1010)\
**Post date:** [October 4, 2019, 10:15pm UTC](https://forums.solar2d.com/t/round-object-rotate-but-not-its-image/150137/3 "2019-10-04T22:15:11Z")

</div>

Thanks, i’ve tried this solution but i was always writing after the physics.addBody this

```
ball.friction = 0.01

```

instead of something like:

```
physics.addBody(ball, 'dynamic' , {radius=7.5,bounce=0.8,friction=0.01})

```

now, for some reason i realized i was doing it wrong, it works correctly, thanks again!
