Way to replace obj overlap with collision

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • If you wanted to make a game with objects that you can interact with, like turn on tv, you would create a collision box in front of it and add event:

    If player overlaps the box and presses space then turn on tv.

    How would I effectivly replace this with collisions?

  • Do you mean by replacing with collisions the player doesn't need to input to trigger the event?

    Would "object collides with x" not achieve what you need? or "when overlaps with x" and "only run event once when loops".

  • No, the trigger event should still be there. I just don't want to use obj overlap but obj collision with another obj instead.
    I have read that obj overlap should be avoided so I am trying to find an effective way to replace it.

    Only thing I have come up with is in the example. If you can't download it:

    I created 1 collision box in front of TV and 3 collision boxes around the first collision box and 1 counter

    • If Player collides with first collision box , count is set to 1
    • If collides with any of the second boxes, counter is set to 0
    • If counter = 1 and press "space", tv turns on.

    It somewhat works but I have to create a lot of extra collision boxes to know when the player is not near the object he can interact with.


    Please login to see this attachment.

  • I can't see there being an issue with putting if pressed space at the top of the event then if overlapping. That way the event is ignored until the player presses space. Placing the over lap at the top will always trigger and test for space therefore waste resources. You could also add to the bottom only run once when loops. As even the briefest press of space would run the event multiple times.

  • Ok so the events would be:
    Upon pressing "Space" and if player is overlapping the box then toggle internal flag 0
    if internal flag 0 is on then TV animation = on
    if internal flag 0 is off then TV animation = off

    this looks really nice and simple to use but I am not sure if this doesn't take a lot of memory. Do the memory problems only occur if it is checking for overlapping every single frame? You said in this case it only checks for overlapping upon pressing "Space". So I should be fine?

    As I said before only reason I wanted to avoid "Check if overlapping with obj" is because I read here Please login to see this link. that "avoid overlap conditions because they use more memory than straight collision detection". The game has quite a lot of objects you can interact with so I wanted to make sure I tackle this problem early.

    Edited once, last by Huntermanx (July 31, 2017 at 11:31 AM).

  • I suspect as long as you aren't testing for overlap as a first condition to test you wont see too much of a problem. I also suspect if you turn off fine collision on at least the box detector (but ideally both) you'll see another reduction in resources.

    I could see 100's of events that are checking for overlap first being an issue but if you're only triggering these events when the player inputs only a handful would be running

    As long as you have upon pressing and not while pressing you shouldn't need to limit the event from running multiple times either and upon pressing only triggers the one time.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!