So I am using one of the pre made joysticks now I saw it has a get angle function which I use in my level to control a character. I have if statements that say depending on the angle use this sprite sheet. That’s works perfect. Now the problem is I need physics to change depending on the angle just like the picture. My sprites dont move to much but move enough to look like its moving in that direction. Now I get stuck where I can get it to change the physics also when the image changes by using physics.remove() the problem is if i don’t use the remove function too before changing direction the physics will not change only the image if I use the remove in the move function the image is glitchy because I think it is constantly trying to remove and add the physics. So what I trying to say is I have four if statements the say depending on the angle use this image and the physics but can’t seem to be able to remove the physics just once to add a different physics to match the image
Hi @keithholler13,
By your description, it all sounds logical enough, so there’s likely something wrong with the code or approach. Can you post some relevant code which shows how you’re doing this? Also please surround it by “lua” tags for clarity:
[lua] ... [/lua]
Thanks,
Brent
I actually posted a new post underneath this one with the code called Cycling physics based on animation. I was not sure if it posted and I got my friend to post it for me. So please take a look any help would be appreciated.
Hi @keithholler13,
OK, I responded to that other post:
http://forums.coronalabs.com/topic/53737-cycling-physics-based-on-animation-image-question/
Brent
Hi @keithholler13,
By your description, it all sounds logical enough, so there’s likely something wrong with the code or approach. Can you post some relevant code which shows how you’re doing this? Also please surround it by “lua” tags for clarity:
[lua] ... [/lua]
Thanks,
Brent
I actually posted a new post underneath this one with the code called Cycling physics based on animation. I was not sure if it posted and I got my friend to post it for me. So please take a look any help would be appreciated.
Hi @keithholler13,
OK, I responded to that other post:
http://forums.coronalabs.com/topic/53737-cycling-physics-based-on-animation-image-question/
Brent