Hi.
I have a gun and I want to change the bullet image by touching an certain object.
I already have a function that shoots the bullets, but when I touch the object to change the image, a shot goes against that. I want that not to happen. In other words, I want the shooter function not to shoot against the “image changer”.
Can someone help me? [import]uid: 162818 topic_id: 31859 reply_id: 331859[/import]
If you want change the bullet image by touching a certain object then write a function to remove the first image and display the second and add a touch listener to the certain object you want to touch.
… or if you are talking about physics objects write up a clear description of your problem, in detail, and we’ll try to assist you. (You may want to include code/plug and play.) [import]uid: 52491 topic_id: 31859 reply_id: 127162[/import]
Your touch might be “falling through” the Change Bullets object and activating the shooting routine. For example, if you tap the screen to shoot at that spot, but then tapping the “Reload” button also shoots at that spot, that may be your problem.
If you “return true” at the end of your touch function for changing bullets the touch won’t continue propagating down through all the objects. The reload function gets the touch and then when you return true, nothing else sees the touch.
Or, if that has nothing to do with the problem, like Peach said, post some code.
Jay
[import]uid: 9440 topic_id: 31859 reply_id: 127170[/import]
If you want change the bullet image by touching a certain object then write a function to remove the first image and display the second and add a touch listener to the certain object you want to touch.
… or if you are talking about physics objects write up a clear description of your problem, in detail, and we’ll try to assist you. (You may want to include code/plug and play.) [import]uid: 52491 topic_id: 31859 reply_id: 127162[/import]
Your touch might be “falling through” the Change Bullets object and activating the shooting routine. For example, if you tap the screen to shoot at that spot, but then tapping the “Reload” button also shoots at that spot, that may be your problem.
If you “return true” at the end of your touch function for changing bullets the touch won’t continue propagating down through all the objects. The reload function gets the touch and then when you return true, nothing else sees the touch.
Or, if that has nothing to do with the problem, like Peach said, post some code.
Jay
[import]uid: 9440 topic_id: 31859 reply_id: 127170[/import]
I got it, Jay! Thank you!
Thank you too, Peach. [import]uid: 162818 topic_id: 31859 reply_id: 127450[/import]
I got it, Jay! Thank you!
Thank you too, Peach. [import]uid: 162818 topic_id: 31859 reply_id: 127450[/import]