- This topic has 5 replies, 2 voices, and was last updated 11 months, 2 weeks ago by c4cc.
-
AuthorPosts
-
2023-12-05 at 4:04 pm #68971c4ccParticipant
I need to decide whether or not an object is destroyed when it comes into contact with another.
I decided to reduce said object’s variable’s number (basically a health bar) if it comes into a certain close distance, using get distance puzzle as per below. Then if close enough, I want to hide the object.
Yet the object is not disappearing even though it is repeatedly in contact with another
- This topic was modified 11 months, 2 weeks ago by c4cc.
2023-12-05 at 4:07 pm #68972kdvParticipantyou need to check the distance and set visibility every frame. now your puzzles are executed only once (when the app is loaded) and do nothing afterwards.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-12-05 at 4:25 pm #68974c4ccParticipantSo far, it seemed to work, but I’ll run more tests and see how it goes
Attachments:
You must be logged in to view attached files.2023-12-05 at 4:52 pm #68976kdvParticipantit’s better use only one “every frame” puzzle for all your puzzles.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-12-06 at 3:04 am #68986c4ccParticipantit’s better use only one “every frame” puzzle for all your puzzles.
Thanks, I’ll keep this in mind. Do you mean, joining the puzzles together like this?
Also, in this updated puzzles, I’m trying to get my character to kick an enemy, thus destroying it. As you can see, I set my puzzles to hide the enemy object after the distance between puzzles determines the target is within kicking range, and when the HP is reduced to 0, or more.
But after a few kicks, only does the enemy disappear. Why is there a lag in disappearing?
2023-12-06 at 4:25 am #68987c4ccParticipantAlso, in this updated puzzles, I’m trying to get my character to kick an enemy, thus destroying it. As you can see, I set my puzzles to hide the enemy object after the distance between puzzles determines the target is within kicking range, and when the HP is reduced to 0, or more.
But after a few kicks, only does the enemy disappear. Why is there a lag in disappearing?
On second thought, I may have solved this issue, by differentiating between left and right kicks. So now, my character sofar seems to be able to destroy by left or right kicks individually.
it’s better use only one “every frame” puzzle for all your puzzles.
So do you mean this for only my puzzles that determine damage and distance between objects?
-
AuthorPosts
- You must be logged in to reply to this topic.