Forum rules - please read before posting.

Help. How to attack with bite the enemy?

I found a problem with the man in 2d that when he walks he keeps turning and unbalancing himself.

And another I don't know how to make the lion player bite this man.

Comments

  • You must make sure that the character's sprite is on a child object, and assigned in the NPC component's "Sprite child" field. This will set the sprite's rotation to have it face the camera automatically.

    And another I don't know how to make the lion player bite this man.

    When would you want it to do so? Automatically as he gets close enough?

    Attach a Trigger to the NPC, set its Collider to be larger than that of the NPC's root BoxCollider, and then have it run a Character: Animate Action that plays the Lion's biting animation.

    If your game plays as a 2D game, only with 3D background graphics, you may find it easier to have your characters, camera perspective etc all be in 2D as normal. A 2D scene can still have 3D geometry in it - just use the GameCamera prefab instead of GameCamera2D, as this will allow for perspective projection as it moves.

  • You must make sure that the character's sprite is on a child object, and assigned in the NPC component's "Sprite child" field. This will set the sprite's rotation to have it face the camera automatically.

    Worked, thank you

    When would you want it to do so? Automatically as he gets close enough?

    I would like that when the Lion player gets close enough to the man, he bites by pressing a key on the keyboard or mouse, causing damage to the man, with the respective animations.

  • edited January 2023

    I was watching your game2d video lesson but I don't know how to change the score. Put the score of points that appears on the screen when the person is bitten.

  • edited January 2023

    I was watching your game2d video lesson but I don't know how to change the score. Put the score of points that appears on the screen when the person is bitten.

  • I would like that when the Lion player gets close enough to the man, he bites by pressing a key on the keyboard or mouse, causing damage to the man, with the respective animations.

    Though AC isn't designed for action games, you could attach a Hotspot to the NPC and have the attacking logic be a regular Interaction.

    If you make use of Player-vicinity Hotspot detection, the NPC's Hotspot will be selected automatically as they approach. A tutorial on this can be found here.

    A selected Hotspot can be interacted with through the "InteractionA" input, which you can define in your Input Manager.

    I was watching your game2d video lesson but I don't know how to change the score. Put the score of points that appears on the screen when the person is bitten.

    You can use an Global Integer variable to keep track of the Player's score, and display its value in a Menu's Label element. A tutorial on this technique can be found here.

  • edited January 2023

    I am not able to find the problem, I recorded a video showing the player objects and the man and the children of the objects to find an error. There is simply no interaction when I press the mouse key or any other key configured in the input manager.

    There is a log of warnings in the shared image of a screenshot the animation error warning I can solve this animation error later
    while the
    others I'm not getting.

    warnings

    https://uploaddeimagens.com.br/imagens/zTNYVQc/mostrar-codigo

  • Looks nearly there - the inputs and Hotspot settings look fine.

    Though, this warning is appearing among the Console messages:

    Both a Player and a Hotspot Detector on that Player are required for Hotspots to be detected by 'Player Vicinity'

    To fix it, assign the Hotspot detector in your Player component's Hotspot detector child field.

  • To fix it, assign the Hotspot detector in your Player component's Hotspot detector child field.

    OK. resolved, that warning no longer appears.

    But the problem still persists. I recorded a new video using this time a cube, the hotspot detector seems to work but no action works when I click the mouse button or other configured in interactionA.

  • Can you share a screenshot/video showing your full Settings Manager? I'll need to use the same values to attempt an accurate recreation.

  • edited February 2023

  • edited February 2023

    I found the problem is in interface settings. But it only works by unchecking ''lock cursor in screen'centre when game begins''. When I mark the problem arises.

  • edited February 2023

    When the lion approaches, detecting the Man's hotspot, a message appears next to the cursor, instead of appearing on the screen above the man. How to take it off?

  • For a one-click interface (i.e. a Hotspot is interacted with via a single key/button-press), set the Interaction method to Context Sensitive.

    When the lion approaches, detecting the Man's hotspot, a message appears next to the cursor, instead of appearing on the screen above the man. How to take it off?

    The label is appearing within the Hotspot menu, which by default is set to be positioned above the cursor.

    To have it appear above Hotspots, go to the Menu Manager, select the Hotspot menu, and set its Position property to On Hotspot.

  • Solved, thank you.

  • edited February 2023

    If your game plays as a 2D game, only with 3D background graphics, you may find it easier to have your characters, camera perspective etc all be in 2D as normal. A 2D scene can still have 3D geometry in it - just use the GameCamera prefab instead of GameCamera2D, as this will allow for perspective projection as it moves.

    I noticed that all objects in 3d from the perspective of the camera are as if they were 2d. I used camera 2d.

    What configuration do I use so that the camera follows the player in the same way, only with the objects mainly those in the background like the wall responding to the 3d perspective?

  • edited February 2023

    See my earlier comment:

    A 2D scene can still have 3D geometry in it - just use the GameCamera prefab instead of GameCamera2D, as this will allow for perspective projection as it moves.

    A 2D scene's Scene Manager will provide "GameCamera 2D" as the default camera type. If you instead use "GameCamera", which is the default for 3D scenes, it'll allow for perspective changes as it moves.

    You can use this camera by dropping its prefab into the scene manually, from /Assets/AdventureCreator/Prefabs/Camera.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.