CGSpot's Recent Forum Activity

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > 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.

  • The preview is stuck on the loading screen when I use the MoveTo behavior for a particular sprite.

    That sprite is just placed in the Construct 3 layout and doesn’t have any events or actions linked to it.

    Can anyone please explain what I might have done wrong?

    More info:

    - The sprite has animations and multiple image points.

    - The sprite is placed inside the viewport.

    - The layout that contains the sprite has no event sheet.

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

    Error video: webmshare.com/play/8PnAX

  • Fixed it using

    clamp((number + value), 0, 100)

    Thank you helping..

CGSpot's avatar

CGSpot

Member since 16 Dec, 2024

None one is following CGSpot yet!

Connect with CGSpot

Trophy Case

  • RTFM Read the fabulous manual
  • Email Verified

Progress

2/44
How to earn trophies