Nabu's Forum Posts

  • There is no "facing" condition. You have to check wich animation the player is actually playing if you have one for to go left and one for right.

    Add a condition, select your player, under "animation" select "is playing" and the animation you want. For example, if animation "left" is playing, then shoot left.

    I can make you a little example for these kind of tests.

  • Of course, when the player shoots (I don't know your implementation, maybe post your project, or a simple one), I imagine you do the action "player => spawn bullet, or system => create object Bullet at Player.X Player.Y", just after this line in the editor your click on "Add action" and "bullet => set angle of motion to Player.Angle".

    In the editor you can quickly retrieve variables (like "Player.Angle" from objects with the little window that opens when you create or edit an action or condition.

    Or if you game is a plateformer, barely the same : spawn bullet, then create a condition "if player is facing left (by testing its angle or animation) => set bullet angle to 180 (left)", create an "else" condition and "set bullet angle to 0"

  • Yes, and the Pin behavior has nice effect like "hook" or "bar" to follow your character.

  • Hello,

    Here's things you can do :

    • use a boolean instance variable for your object, setting it to false when it dies and check for it when interaction. So during any interaction action, if it's dead, do nothing. It does not reduce the amount of object though. You can also disable collision for the object so it does not trigger anymore and saves a bit of cpu.
    • Using the Paster or Canvas plugin, maybe you can create a paster on a layer, the size of your layout and paste on it the sprite when it dies and destroy the object. But you can do no interaction with the dead object after this.
  • Hi,

    You cannot specify witch object to be an obstacle for LIne Of Sight behavior (as well as Pathfinding behavior), but only object type or entire family. The "add obstacle" action applies to all instances, it's construct 2 built in.

    So depending on what you want to achieve, you'll have to avoid this.

    Maybe you can tell more about your project and we can find a solution.

  • Hello,

    Maybe you can post a simple .capx so we can see your implementation.

    However, when you the player shoots you can give the bullet its angle :

    • Spawn bullet at player
    • Set bullet angle to player angle

    Or

    • If player if facing left
    • Set bullet angle to 180

    Else

    • Set bullet angle to 0

    Depending on your type of game. If you use the bullet behavior, setting the angle of object might does not be enough and you'll have to set the bullet behavior angle of motion instead, (if bullet behavior set object angle to angle of motion property is unchecked).

  • Problem Description

    Physics behavior bug / crash when creating objects on the fly

    Attach a Capx

    https://www.dropbox.com/s/et90z0zdwswqepe/physics_bug.capx?dl=0

    Description of Capx

    Simple layout with physic objects. Left mouse click to spawn coins high rate.

    Steps to Reproduce Bug

    Just spawn some objects with left mouse click, (hundreds of them, it's fast) and the crash will happen.

    Observed Result

    App crash with physics behavior related debug data.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)
    • Safari: (YES)
    • NodeWebkit export: (YES)

    Operating System and Service Pack

    Windows 7 SP 1

    Construct 2 Version ID

    r208 beta

  • Hello everyone,

    I encountered these kind of bugs many times when creating objects on the fly without being able to find the bug or present here a clear capx for debugging. However I'm interested in further investigations about the same subject, probably like other persons as I saw many physics behavior related bugs simply closed because of too few information or no good capx.

    So if the devs can spend some time on it, even if nobody can provide good capx, it would be great.

    I opened a new topic with a clear version of your capx, that reproduces the bug in one event, by just creating objects in chain.

    https://www.scirra.com/forum/viewtopic.php?f=151&t=148526

  • Hello,

    Is it possible to set up a split screen game with this plugin in some way ?

  • Hello,

    One thing you can do is have a sprite for your characters or monsters or whatever, and an invisible sprite pinned to it, with the shape you want, and a little bit smaller for the collision. Thus the laser will overlap with the entity's sprite and will only be destroyed once it has collided with the inner collision sprite.

  • I need helpppp

  • Thanks for the reply. It works in the little example project but I still got the lag on my big projet. Do you think many events can make the lag when the positions are updated ?

  • Hi,

    Maybe you can use a function to store character data into a global array when a character leaves the layout. And when you go to that layout, re spawn a character with the data you stored, to reproduce the previous one, and make it go where you want or spawn at a specified location.

  • Try Construct 3

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

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

    I have a character with a base and multiple parts. Some are pinned to the base or the one another, and some others have their position set every tick at image point cause the Pin behavior can't do this. The problem is that it creates a lag in the movement. Positions seems to not be moved at the same time. Is there any way to prevent this ?

    Here's a capx for example. I commented the line where the part 2 is pinned to the part one, cause I'd like it to be set every tick at an image point. So every tick, the part 2 is set at part 1 position and angle.

    https://www.dropbox.com/s/2nrkrxxxf9welm7/pinMoToPosition.capx?dl=0