Collision Mask, Image points, Hotspots, Invert Conditions?

This forum is currently in read-only mode.
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • Hi, I'm Larry The Internet Guy and I'm new (1st post!). I'm building my first game. Can you help me understand these?:

    *Collision Mask questions

    +Does it matter if you make the collision mask first before drawing your animation?

    +I clicked the collision mask button, then I used the rectangle tool to make a red box and then I used the flood fill tool to fill the box in with red. Is this way of creating the collision mask okay, or will I run into problems doing it this way?

    +Should the Collision mask cover the entire character?

    +I drew a collision mask for the first frame of my animation but when I clicked on the second animation in the strip and then clicked the collision mask button, I noticed that the collision mask wasn't on the second animation... Do I have to create a collision mask for each animation?

    *Image Points and Hotspots questions

    +What is the difference between the two? In what situation would I use a hotspot?

    +I've used Image points to mark spots for collisions. Is there a reason why they're not called collision points"?

    +If I already have a collision mask on a character, why would I use image points for collisions?

    *Invert Condition

    +What does it mean? What does it do?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.

    Yup, that is fine for creating collision masks. Then, if you want each frame to have it, right click the frame with the right collision mask and you should see an option like "copy collision mask to all frames" I think.

    EDIT: Just re-read, yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.

    That depends on if you want the character to be collided with entirely. Sometimes you only want a certain part of it to collide (eg: you usually don't check if the string of a balloon is colliding with something, that would just make the game look buggy).

    The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.

    Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.

    Sadly, image point collision only works for the hot spot I think. However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.

    Invert means that whenever the condition is not satisfied (eg: inverted always events never happen, while always events will always happen).

  • Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.

    I can do that, but how do I do it without the collision mask being slightly in a different place in each frame? Like, how do I get it precisely in the same spot for each frame?

    yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.

    Hmmmm... I'm not entirely certain what you mean here. Are you saying that there is no way to just create one collision mask and then make it automatically appear on each frame?

    OR

    Are you saying that if I create one collision mask, and then edit the collision mask it will generate itself for every frame?

    I'm confused.

    The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.

    So does this mean that I should always use a hotspot for an animation? And should I always center the hotspot in the middle of the character model unless I want the model to bounce when it moves in some frames?

    Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.

    I'm able to attach a gun to the player this way, but I can't get the gun to stay on the players image point. In fact, the gun goes right to the top of the players head for some reason. I'm doing something wrong but I don't know what exactly.

    Sadly, image point collision only works for the hot spot I think.

    I'm not sure what you mean. Can you elaborate on that? I've made collisions between two characters using image points without using hotspots before. Are you saying that I should always use both together if I'm using image points for collisions?

    However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.

    So if I'm going to use image points for collisions, I don't have to use a collision mask?

    Also, what is a "bounding box"?

  • > Collision masks may end up being overwritten by the animation frame if you create it first. However, you can just copy and paste the collision mask back later.

    >

    I can do that, but how do I do it without the collision mask being slightly in a different place in each frame? Like, how do I get it precisely in the same spot for each frame?

    > yes, you need a collision mask for each animation frame, but it will be generated automatically when you edit it if you do not have a custom one.

    >

    Hmmmm... I'm not entirely certain what you mean here. Are you saying that there is no way to just create one collision mask and then make it automatically appear on each frame?

    OR

    Are you saying that if I create one collision mask, and then edit the collision mask it will generate itself for every frame?

    I'm confused.

    > The hotspot is the "centre" of the sprite, the point that you pull X and Y values from. This is also the point that the sprite rotates around.

    >

    So does this mean that I should always use a hotspot for an animation? And should I always center the hotspot in the middle of the character model unless I want the model to bounce when it moves in some frames?

    > Image points are handy for attaching objects to each other, for example in an action game you can attach a gun to the players hand by having an image point there that moves with each animation frame. They also rotate with the sprite.

    >

    I'm able to attach a gun to the player this way, but I can't get the gun to stay on the players image point. In fact, the gun goes right to the top of the players head for some reason. I'm doing something wrong but I don't know what exactly.

    > Sadly, image point collision only works for the hot spot I think.

    >

    I'm not sure what you mean. Can you elaborate on that? I've made collisions between two characters using image points without using hotspots before. Are you saying that I should always use both together if I'm using image points for collisions?

    > However, you can choose three different collision modes "per pixel", "bounding box", and "image point". Collision masks are only used in per pixel mode.

    >

    So if I'm going to use image points for collisions, I don't have to use a collision mask?

    Also, what is a "bounding box"?

    1. If you right click the frame with the correct collision mask, there is an option to copy it to all frames of the currently selected animation.

    2. I am saying that whenever you don't create a collision mask for a new frame of any animation, one is created to match any non-transparent pixels of the image. Sorry to confuse you about that

    3. A hotspot will always exist in every animation, it does not need to be centred on the sprite, but you can automatically change it for all frames of an animation by holding alt and clicking while in hotspot editing mode I think. The hotspot is the "base", if you imagine a string puppet, its the point where the central string is connected. That can be the head, the feet, or anywhere else in between. However, keeping a consistent hot spot should reduce the bouncing of your animations

    4.I tend to number my image points rather than name them, starting from 1. This way when I use "Set position to object" actions I know exactly which number of image point they are connecting to (0 is the hotspot)

    5.I've not tried much in that respect, but I thought image point collisions only work for the hotspot. If not, cool, that makes it much more useful But no, you don't need both, only a hotspot is always needed for a sprite.

    6.And yup, you don't need a collision mask for image point collisions. They are only used in "Per pixel" collision mode in the sprite settings. Bounding box is where the sprite is treated like a solid box when it comes to collisions. It's similar to your filling of the sprite with a red square, but does it automatically for you

    Hope this helps clear some things up

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)