Help with sprite following mouse

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have a player sprite and a solid object sprite.

    To make the player follow the mouse, I have:

    Every tick

    -> Set Angle Toward Mouse

    -> Set Bullet Speed based on distance between sprite and mouse

    The bullet behavior includes bouncing off solids, and the wall is a solid. The collision happens just fine, the issue is when the player approaches the wall at an angle such that he is nearly parallel to the wall, the sprite speeds up and slides along the wall much faster than normal.

    My guess is there's just a better way to do it. What should I change or look into? I can't find any solutions other than this and using move forward instead of bullet (but then I don't know how to make it collide at all)

  • Do you have a .capx file we could take a look at?

  • I'm getting a message saying I'm not allowed to post URLs. How can I get this to you?

    Edit: Here, maybe this will work: https[colon]//

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rstevoa

    I would guess we'd have to see the cap file to know for sure, but I'd check the settings on the bullet behavior, too. Is 'set angle' on/off? Try it with either and see what happens. Also, check your collision boxes in the sprites, as any overlap plays havoc with bullet behavior.

    You can set to detect collisions manually, too, without any behavior. Try adding a 'On Collision' event without the bullet behavior and alter the angle on collision; the 'Move Forward' action moves it in accordance with the angle.

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