CGSpot's Forum Posts

  • Thank you very much for the help.

  • The support character will spawn from the barracks from time to time to help the hero, and after a certain period, he will return to the barracks.

    I'm using the Tween behavior when the support character is created—to show the distance from the barracks.

    When he returns (and is destroyed), I'm using position and scale with lerp to move him back to the barracks.

    It feels a bit laggy and doesn’t look smooth.

    Can you guys help me create a better and more polished functionality?

    Functionality video: webmshare.com/play/AZAbP

    Create event:

    Destroy event (go back):

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The gun is set to not mirrored in both cases, that is intentional ?

    yes, i change to Pin and fixed it with these events

  • is Tower_1_Soilder the one that enters from that hutch?

    yes,

    and i connected the "soldier" and "gun hand" using hierarchy when created.

  • When the character shoots the enemy, the gun angle is not working correctly. The gun hand is supposed to follow the angle of the enemy he is shooting.

    Events:

    Error Video: webmshare.com/play/ZJbvd

    (Note: I know the drag-and-drop of the enemy is buggy—it's just for testing purposes.)

  • I don't know much about turret function but would using -pick nearest,furthest- help?

    edit-sorry I just saw dop2000 already wrote this silly me

    Thanks for the suggestion

  • The Turret behavior is mostly intended for top-down games. In a platformer, especially if you’re only shooting left and right and there are no flying enemies, you usually don’t need it.

    My advice: don’t use the Turret behavior. Pick the nearest enemy and spawn a bullet in its direction.

    If you really want to use the Turret behavior, create an invisible sprite just for it. This way, you can combine the character and the gun in one sprite and mirror them easily.

    Also, use hierarchy instead of the Pin behavior — child objects in a hierarchy will automatically mirror when the parent sprite is mirrored.

    Thank you very much, i will try alternative for Turret

  • I have a support soldier character who should follow the hero character automatically.

    The hero can move left, right, and jump.

    The support character will only move left and right, following the hero.

    The player has no control over the support character—it should behave like AI and shoot enemies.

    For the support character:

    - I have to sprites: "soldier body" and "hand with gun".

    - "Soldier body" has the Platform behavior.

    - "Hand with gun" has both Pin and Turret behaviors.

    - There are multiple enemies, and the Turret behavior automatically picks one to shoot.

    Problem:

    When the turret is shooting and the "soldier body" is not facing the enemy, the turret flips, but the soldier body does not.

    I want both the "soldier body" and his "hand" to face the specific enemy he is shooting at—regardless of movement direction (left or right).

    I’ve tried using enemy.X to mirror the "soldier body" and "hand", but it doesn’t work correctly when there are multiple enemies.

    I want the support character to mirror based on the specific target the turret is shooting at, not just any enemy.

    Create Event:

    Shoot Event:

    Error Video: webmshare.com/play/qOvP7

  • I would start with the pick enemy logic, so whatever enemy is picked you can have its UID set as a variable on the support char so you know which enemy is connected (support.var). You didn't mention how it is picked but for example if it is the nearest enemy to player you can do that, pick enemy nearest to player and set support.var to enemy.UID

    Then this helps solve the facing issue, you say pick enemy where UID = support.var, if support X is less or greater than the enemy then mirror the support char accordingly.

    For shooting depending on how simple it is, if its just left or right then you can fire bullets and set the angle based on if the support char is mirrored or not, either 180 or 0. If it is more complex angle of shooting then you can just pick the enemy by UID support.var again and set the bullet angle towards the enemy.

    The support char would then stay mirrored or not based on the enemy X so you are free to move the support char in terms of following the player how you wish.

    Thank you, i would try this

  • I have a Hero, a Support character, and multiple enemies on screen coming from both sides of the layout.

    I want the Support character to:

    - Pick an enemy and shoot at it.

    - Follow the Hero if the Hero moves.

    - Always face the enemy he’s shooting at, even while moving, whether moving forward or backward.

    I tried using the Turret behavior for the Support character, but it’s not working well. I also couldn’t get him to mirror correctly toward the enemy he’s shooting at. I’m currently using the Platform behavior for movement.

    Can you please help me figure this out?

    What combination of behaviors and events can give me the result I’m expecting?

    Events:

    Gamepage:

  • > Here is the C3 file: dropbox.com/scl/fi/mb228nls4kea606vcqf0d/Horizon-Defense-v1.zip

    The preview works for me in Chrome.

    I would try clearing all browser data (not just cache), or trying a different browser.

    Its working now,

    I cleared the all browsers catch and cookies and reinstalled it.

    Thank you

  • > Here is the C3 file: dropbox.com/scl/fi/mb228nls4kea606vcqf0d/Horizon-Defense-v1.zip

    The preview works for me in Chrome.

    I would try clearing all browser data (not just cache), or trying a different browser.

    Ok, Thank you...

    I would try that and let you know.

  • By far the easiest way to get help is to share your project. That way others can try it out. Nobody can tell much from just watching a video, and so all you'll get are the usual general-purpose advice, which includes: try disabling any browser extensions you have installed, as often mysterious problems are caused by browser extensions interfering with Construct. You could also try clearing your browser cache.

    Here is the C3 file: dropbox.com/scl/fi/mb228nls4kea606vcqf0d/Horizon-Defense-v1.zip

    Tower_1_Soldier has the MoveTo behavior

  • Does it work if you remove the behavior and then re-add it? Maybe it's some random bug.

    Do you have other objects with MoveTo behavior?

    Are you using any addons? It's possible that some of the addons is somehow clashing with MoveTo plugin.

    1. I’ve tried removing and re-adding it, but it’s still not working.

    2. Only one object has the MoveTo behavior.

    3. I have no browser addons, and I even removed Chrome’s default extensions.

    4. And for Construct 3 Addons, I only use the usual ones in the project (Audio, Browser, Keyboard, Mouse, Platform Info, Touch)

    5. Installed addons also not much

  • > I tried disabling the MoveTo behavior and running the preview, but it still doesn’t work.

    So why do you think the problem is with the MoveTo behavior?

    Press F12 in preview and see if there are any errors in the console log.

    I have checked the console log, it shows this error

    If I delete the MoveTo behavior and run the preview, it's working fine, can you please check the video.