solids not working

This forum is currently in read-only mode.
0 favourites
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • I've changed my sprite to a physics movement, but now I need to be able to move my sprite at a specific angle.

    http://dl.dropbox.com/u/2867484/brokenSkyline.cap

  • .cap file is blank

  • .cap file is blank

    No it's not... try opening the Level1 layout

    Anyway, the problem is you're trying to use physics collisions, but you're not telling the player to move using physics movement. You're telling the player to move using set pixel amounts. Physics doesn't work that way.

    If you are using physics, you can only tell physics objects to move using force or acceleration in the physics tab of the actions for the object. You can only tell the physics object to rotate using torque or angular velocity.

    You cannot tell a physics object to "rotate n degrees" or "move n pixels." You're doing it wrong.

    Basically it works like this: The Physics behavior is a simulation. It runs all the collisions in the behavior itself. It's a totally separate thing from 8Direction or Platform interacting with solid objects. Physics doesn't care if an object is checked "Solid."

    Physics objects only collide with other physics objects, period.

    If you want physics objects to collide then you need the physics engine to do the work for you. If you tell the sprite to "move n pixels" then it totally skips the physics engine and move the pixels like you asked. But the physics engine doesn't know you just move the sprite. It doesn't know you just intersected with a solid. Moving those pixels is not part of it's simulation. The physics engine still thinks the sprite is sleeping away perfectly still where it started off.

    Anyway, long story short: Physics and regular pixel movement (including other behaviors) don't mix. Physics only works with physics.

  • Well then, I guess I'll redo everything

    How do I get a physics ball to "bounce" off a wall?

    And: what's the physics equivalent "move at Angle"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is there as a good Physics Tutorial anywhere?

  • Is there as a good Physics Tutorial anywhere?

    already searched

  • How do I get a physics ball to "bounce" off a wall?

    You don't have to "get" it to. It automatically does it.

    And: what's the physics equivalent "move at Angle"

    "Set force towards position," or "Add force towards position," or "Set Velocity." Here's a method using Set Force:

    http://dl.dropbox.com/u/529356/physics%20ball.cap

    Just one event, one action, and as you can see all the collisions are done for you. That's what physics does... it just calculates speed, force, and collisions.

    If you're making a game where you're manually moving a player around then you might want to look into Custom Movement instead of Physics, though. Physics is more for manipulating things indirectly, like pool balls or pinball or knocking walls down with cannonballs and stuff like that. It's not very good for direct player control in most situations because it's unpredictable... things go knocking around in all sorts of crazy ways.

  • Nice Expiation and example

  • What version of construct did you make that on? I'm getting the "out of memory" error

  • Ah, I knew I forgot something

    It's 0.99.82

  • Ah, I knew I forgot something

    It's 0.99.82

    .82? I have .62

  • So get .82 v<img src="http://www.scirra.com/forum/images/smilies/icon_confused.gif">v

    It's always a good idea to have the latest build, even if you're just using it for testing. If you still want to make your game in .62 that's fine, you can have more than one version of Construct installed at a time.

    Generally I assume that everyone has the latest build, it makes it easier on me when making example .caps.

  • Ok, I saw your example, but I need my sprite to move in a specific angle.

  • Okay. Are you still set on using physics for your player movement? I assume the angle you want to move in is the angle in which the player is facing, like in your .cap.

    If so, this might help you:

    http://dl.dropbox.com/u/529356/physicsMove.cap

    v0.99.82

    Use arrows to move. This uses "Set Force towards Position," which is the easiest way I think to set up movement like this with physics. The position in this case is an image point on the player sprite itself. Open the sprite in the image editor to see where the image point is placed. There is also a second one at the back so you can move backwards.

    You might notice though that it's still pretty floaty. It would take some tweaking to get it so the player doesn't slide around like that. Also, the elasticity and friction have all been set to 0 for both the player and the walls to keep from bouncing when you hit, or rolling when you sideswipe a wall.

    Your might want to look at 8Direction or Custom Movement though. They both support collisions and can be customized for this kind of movement pretty easily, and you won't have any of the drawbacks of using physics for your player movement.

  • Okay. Are you still set on using physics for your player movement? I assume the angle you want to move in is the angle in which the player is facing, like in your .cap.

    If so, this might help you:

    http://dl.dropbox.com/u/529356/physicsMove.cap

    v0.99.82

    Use arrows to move. This uses "Set Force towards Position," which is the easiest way I think to set up movement like this with physics. The position in this case is an image point on the player sprite itself. Open the sprite in the image editor to see where the image point is placed. There is also a second one at the back so you can move backwards.

    You might notice though that it's still pretty floaty. It would take some tweaking to get it so the player doesn't slide around like that. Also, the elasticity and friction have all been set to 0 for both the player and the walls to keep from bouncing when you hit, or rolling when you sideswipe a wall.

    Your might want to look at 8Direction or Custom Movement though. They both support collisions and can be customized for this kind of movement pretty easily, and you won't have any of the drawbacks of using physics for your player movement.

    Ohhh, I never thought of using image points, thanks. But out of all the movements, which do you think I should use?

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