How does Solid work?

0 favourites
  • 14 posts
  • After some toying around, I was able to determine that adding the 8Direction behavior to an object allowed it to be properly stopped by the Solid behavior.

    However, after following scirra.com/tutorials/413/di ... -animation this help on how to make an object with direction based animation, I'm still passing right through solid objects, either over or under depending on the z-order.

    I feel that if I properly understood how solid worked, I would be able to prevent this from happening. At this point, I'm at a loss.

  • Just checking, your player and solid objects both have collisions enabled right?

  • Yeah, they sure do.

  • Hm, yeah sorry I don't really know much about solids except that they affect built-in behaviours like 8direction and platform, as well as physics I think? You're sure the 8direction behaviour is enabled too right?

  • Yeah, the object is 8Direction and the solid object is on the same layer.

  • I went ahead and set an event for when the moving object collides with the solid object to stop, but this is not working either. Although both objects are on the same layer, they are not colliding.

  • If an object has 8-direction it should collide with a solid object, you shouldn't need to set an event to make it stop so something has gone wrong there.

  • Set the collision polygon (preferable to the bounding box) and the origin for each animation frame the same. My wild guess.

  • I checked to see if the Z Order was the same for both objects. I'd assume that even though they are on the same layer, they don't start at the same Z Order. I can set the Z Order to the top or the bottom of the layer, but the trial does not allow me to set the Z order specifically, to make sure both objects are in the same Z order to trigger a collision or even stop because they are solid. Could this be causing the trouble? If it is, it seems kind of silly, because I wouldn't be able to actually try out the software before buying it, because I can't even get objects to collide.

  • Layers and Z order are kind of irrelevant here. If you have a solid object in the level and you push into it with an 8-direction object, then they should collide. If they do not collide then you must've tweaked something with one of the objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nope. I haven't changed anything from the install of last night. I will just start a new project. I'll create a tiled background for the first layer, then lock it like in the tutorial. I start a new layer on top of it. On this layer, I have two objects: One solid, one 8Direction. They do not collide or stop.

    The two sprite objects both have this second layer as the layer under it's properties in 'Common'. Depending on changing the Z Order, the moving object will pass over or under the solid object but won't stop.

    The only events I have for the moving object are Every tick set angle towards mouse, and move forward when left button is down. The behavior I have for the moving object is 8Direction. The behavior for the solid object is Solid. That's all I have.

  • Have you disabled 8-direction behaviour? I can't see why you would need that move forward event.

  • plinkie Suggested right. In 8-direction there's no disabling of solid collusion. It can be disabled only if 8-direction disabled. Also in case of manual movement like "Move at Angle", "Sprite.X+10" collusion won't work.

    When dealing with collusion and having some issues always recheck:

    *Make sure Solid "enabled"

    *Make sure collusion with Solid objects enabled in Behavior you use for moving object

    *Check collision polygons (in left-bottom of image editor) both of moving object and solid. It may be not be the reason of objects not colliding, but often reason of incorrect collusion. So don't forget always to check this one if something wrong.

    Also making moving object to rotate towards mouse if that's the one that should collide with solid is not a good solution.

    It's better to use invisible object for collusion with solid and visible object for everything else set to be in same position as invisible one.

  • Are you using physics by any chance?

    Physics and solids do not work together.

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