grimwolf's Forum Posts

  • Combining what the others said, you could turn off the sprite's collision, move to the right, then if the sprite is Overlapping a wall you move to the left each tick 'till it is no longer overlapping and re-enable collision.

  • I figured it out myself.

    First of all, System > Scroll to Object is better if you have multiple things to track the camera on. Apparently the Camera behavior for objects is just meant for when you have a single mobile point of focus, like a Player sprite in a platformer.

    I fixed the issue by setting a variable whenever the projectile was created, then when the variable reads true I have the sub-event Pick Nth Object > Object.Count-1 (Object being the name of the projectile), then as the action for that event I have it Scroll To Object.

    When the object lands or is destroyed, I just set the variable back to 0 and Scroll To back to the ballista once.

  • As you've noticed mouse clicks register as Touch as well, so it may be more effective to, instead of using that touch box, use Is On Mobile Device found inside the System conditions.

    Assuming the goal here is to make the game function differently for mobile devices than computers, while working on either.

  • After spawning the particle, you can use Set Angle on it to get the angle you want.

    You can even set an angle relative to the object spawning it by setting the angle to something like;

    Object.Angle+95

    Object being the name of the object you want to align it to, and +95 would off set the particle's angle by 95 degrees.

  • I'm trying to lock the camera onto a projectile, and having trouble.

    I have the camera assigned to an invisible sprite.

    I can get this effect easily by Pinning the camera to the projectile On Creation, then moving the camera back after the projectile lands. But the problem with this is Pin is much too inaccurate and has noticeable lag when moving at high speed like this.

    I can use Set Position to Another Object every frame to set the camera on top of the projectile while it's flying, but I don't know of a way to distinguish one instance of the object from another like On Creation allows, so when an earlier projectile is stuck in the ground it can't find the proper one to stick to.

    I could probably add the camera behavior directly to the projectile, then create a secondary version of it with no camera behavior to replace it with after it lands, destroy the original camera after the the projectile is launched and respawn it after the projectile is replaced.

    But I have some complex actions going on with the projectile and replicating it all on the replacement projectile would create some pretty messy and complicated events.

    As one example, the projectile is a giant ballista bolt, and if an enemy is hit they get impaled and travel with it. I don't even know how I would re-pin that specific enemy to that specific bolt, because of my earlier issue of distinguishing one instance of an object from another without using something like On Collision or On Destroyed.

    Does anyone know of a good way to do this?

    I could use Pick Nth Instance to find the newest projectile I think, but I have no idea how to automatically acquire the newest one.

    Edit: I tried using Pick Nth Instance with Object.Count to get the highest number, but I then realized I have no idea how Pick Nth Instance is supposed to actually "pick" an instance at all, and can't get it to work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Awesome, thank you!

    Works perfectly.

  • I'm working on a game that uses a giant ballista to launch bolts at a physiced fort, where the walls and such can be knocked around and destroyed.

    I want the bolt to stick in when hitting such a wall, but I'm not sure how.

    On a static wall I can just swap out the bolt sprite for a static one that just stays in place after a collision, but then when the wall moves or disappears the bolt will just be floating there.

    I can set an image point on the wall and stick the bolt to it every tick, but then the bolt will stick to exactly the same point regardless of where it actually struck.

    Is there perhaps some way I could register the position of the bolt relative to the position of the wall's Origin on a collision, then set it to that every tick?