Hi guys, this is my first post on these forums so be easy on me
I am working on a Role Playing Game that uses a tiled map with the addition of monsters which rely on physics to determine projectile weapon impacts etc …
Somewhat randomly BUT it could be when monsters collide OR change direction (I have not isolated it exactly) the monster object appears to rotate. It did not do this before I added physics to the game and I have set the addBody method using a friction and bounch and density of 0 which to my knowledge should mean they do not rotate like this.
Below you should see what I mean. The wolf looking critter with the green bar below is actually several degrees rotated and should not look like this.
Have you tried adding “.isFixedRotation = true” to the monsters? That should stop them from being able to rotate. If you’ve already tried that them i’m not too sure what the problem is…
[import]uid: 69826 topic_id: 37082 reply_id: 145315[/import]
Try setting the [lua]isFixedRotation[/lua] property of your physics objects to [lua]true[/lua]. (See http://docs.coronalabs.com/api/type/Body/isFixedRotation.html) This will prevent your objects from rotating even if they are hit in such a way that a normal object would rotate.
Hope this helps!
Andrew [import]uid: 109711 topic_id: 37082 reply_id: 145316[/import]
Have you tried adding “.isFixedRotation = true” to the monsters? That should stop them from being able to rotate. If you’ve already tried that them i’m not too sure what the problem is…
[import]uid: 69826 topic_id: 37082 reply_id: 145315[/import]
Try setting the [lua]isFixedRotation[/lua] property of your physics objects to [lua]true[/lua]. (See http://docs.coronalabs.com/api/type/Body/isFixedRotation.html) This will prevent your objects from rotating even if they are hit in such a way that a normal object would rotate.
Hope this helps!
Andrew [import]uid: 109711 topic_id: 37082 reply_id: 145316[/import]