can anyone of you to do this with Corona

The game is a birds eye view (top down)

I have a character in the center of the screen holding a gun. There is an aiming cursor. The aiming cursor is moved around by the player touching and moving their finger on the phone screen.

I want the character to rotate and face the cursor wherever the cursor is. The character has to remain centered on the screen.

( i tried using physics joint but i’m having no luck)…major thanks to anyone who has an idea.

PS How can i upload an image to this forum? [import]uid: 119483 topic_id: 35028 reply_id: 335028[/import]

Hi @ugobyte,
Certainly, this is relatively simple. You just need to use an “angle between” function to rotate the character to face the cursor. I can provide this function if you need it… just not at this moment since I’m typing on my iPad and don’t have the code to copy. :wink:

Best regards,
Brent [import]uid: 200026 topic_id: 35028 reply_id: 139295[/import]

@Brent Sorrentino, please if you can post any examples, it will be greatly appreciated. [import]uid: 119483 topic_id: 35028 reply_id: 139316[/import]

Take a look at the mathlib I’ve posted in the Code Exchange. Here’s my collection of libraries and samples:

http://springboardpillow.blogspot.co.uk/2012/04/sample-code.html [import]uid: 8271 topic_id: 35028 reply_id: 139317[/import]

Hi @ugobyte,
Certainly, this is relatively simple. You just need to use an “angle between” function to rotate the character to face the cursor. I can provide this function if you need it… just not at this moment since I’m typing on my iPad and don’t have the code to copy. :wink:

Best regards,
Brent [import]uid: 200026 topic_id: 35028 reply_id: 139295[/import]

@Brent Sorrentino, please if you can post any examples, it will be greatly appreciated. [import]uid: 119483 topic_id: 35028 reply_id: 139316[/import]

Take a look at the mathlib I’ve posted in the Code Exchange. Here’s my collection of libraries and samples:

http://springboardpillow.blogspot.co.uk/2012/04/sample-code.html [import]uid: 8271 topic_id: 35028 reply_id: 139317[/import]