Forum rules - please read before posting.

First person problem

I have a problem with my first person player, it moves forward right left back, but the mouse dosen't work, it dosen't move the camera with the mouse like in a first person game.

«13

Comments

  • edited April 2021

    Welcome to the community, @cipriannnevolnicu.

    To allow for free-aiming, you need to set up two things:

    1. Make sure the cursor is locked, which can be set by default by checking Lock cursor in screen's centre when game begins? in your Settings Manager's Interface settings panel.
    2. Define inputs in Unity's Input Manager named CursorHorizontal and CursorVertical, which are mapped to the Mouse's X and Y axes respectively. These can be renamed/duplicated from Unity's default "Mouse X" and "Mouse Y" inputs, if they are still listed in your Input Manager.

    For full details on setting up First Person movement, see the Manual's "First person movement" chapter. A tutorial on this process can also be found here.

  • Hi, thank you very much for the help, i've changed the settings in the Input Manager and then select Lock cursor in screen's centre when game begins, now it's working fine.
    I have another problem, i want to add audio when player walks and run, in the Inspector the is an audio clips settings for the player, i've added a sound to the walk tab but dosen't work when i move, do i need to do some settings first?

  • Is there anyway to disable the name off the hotspots when playing, i don't want to show text when i chose the sword for example.

  • i want to add audio when player walks and run, in the Inspector the is an audio clips settings for the player, i've added a sound to the walk tab but dosen't work when i move, do i need to do some settings first?

    You'll need make sure your Player has an AudioSource component attached, which is necessary for audio playback.

    Rather than using the audio fields directly inside the Player component, though, it's better to instead attach the Footstep Sounds component, which gives you more control over what sounds are played and when.

    See the Manual's "Footstep sounds" chapter for more on this topic.

    Is there anyway to disable the name off the hotspots when playing, i don't want to show text when i chose the sword for example.

    The names of active Hotspots / Inventory items are displayed inside a Hotspot menu - this is provided by the default interface generated when using the New Game Wizard.

    To prevent this text from showing completely, locate the Hotspot menu inside the Menu Manager and check Start game locked off?, which will prevent it from displaying.

    To instead only prevent it from showing the name of the selected item, go to the Cursor Manager, and inside the "Inventory cursor" panel, set the When inventory selected property to Change Cursor.

  • Thank you for the info it helps me a lot. I have another question, i have a hotpsot on a door, i want to change the cursor icon to a custom icon when i'm near the hotspot object, can i do that in adenture creator? Thank you.

  • You can have the cursor change to a custom icon when it's over a Hotspot by either supplying a texture in the Cursor Manager's "Hotspot cursor" panel, or by checking Change cursor based on Interaction? in the "Interaction icons" panel (if your Interaction settings allow for it).

    To have an icon appear over the Hotspot itself, go to the Settings Manager's "Hotspot settings" panel and configure the Display Hotspot icons property. For this to work, you will need to assign a Highlight component in each Hotspot's Inspector - though this can simply be attached to the Hotspot's object.

  • Thank you, it's working. I have another question, say for example a have a hotspot key and i have it in the inventory, when i launch the inventory and select the key i want to use it to unlock a door, can you give me a step by step tutorial on how to do that, in the manual it shows this thing? Thank you.

  • When i'm playing and hit the esc button it shows the menu, how can i remove it?

  • say for example a have a hotspot key and i have it in the inventory, when i launch the inventory and select the key i want to use it to unlock a door, can you give me a step by step tutorial on how to do that

    A tutorial that uses a key/door example can be found here. Though, as this is the 6th in a mini-series of tutorials on interactivity, I'd recommend starting from the 1st.

    When i'm playing and hit the esc button it shows the menu, how can i remove it?

    This is the default Pause menu, listed in the Menu Manager. It shows when pressing Esc because its Appear type property is set to On Input Key, and set to listen out for the escape key.

    To prevent it from showing, you can either just delete the menu - or change its Appear type to Manual. Doing it this second way will keep it in your game in case you later choose to display it another way.

  • Thank you Chris for the answers and for the tutorial. I have another question, when it's loading a new level can i put inbetween a loading screen or a image?

  • edited April 2021

    You can check Use loading screen? under the Settings Manager's "Scene loading" panel, and then specify which scene name/index to use. See the Manual's "Loading screens" chapter for details.

    A tutorial on creating a "loading bar" can also be found here.

    However, it's best to avoid one if you can - and instead optimise your game for faster load times. See the Manual's "Performance and optimisation" chapter for AC-related tips.

  • Thank you for the info. I have another problem i want to discuss. I have a piece of paper on the table, when i click it i want to zoom the paper on the screen so that i can read it.

  • Attach the Moveable component to the paper, and place two Markers in the scene: one where the paper begins, and one where you want the paper to zoom to (this can be a child of the camera).

    You can then use the Object: Transform Action as part of the paper's Hotspot interaction to move the paper to the second Marker when clicked.

    To have it move back, you can either set up another Hotspot interaction on the paper to do the reverse, or create an "Exit close up" menu button to run an ActionList asset that does this. A similar technique is covered starting at this point in the 3D game tutorial.

    Alternatively, it's also possible to make your Paper a "PickUp" object so that you can drag it around to look at from all angles. This script on the AC wiki allows you to move it to/from it's original position automatically.

  • Thank you Chris for the wonderful answers and for the awesome tutorials. I want to add ZoomMoveable and enabling the zoom settings to a pickup object, do i have to add it to the Input Manager? And what to write to the positive button, i tried to write mouse scrollwheel but it didn't work.

  • edited April 2021

    Yes, any input used by AC needs to be defined in Unity's Input Manager.

    You can see a list of any inputs that can be used by your game (once added to the Input Manager), in the Settings Manager's "Available inputs" panel.

    To map an input to the mouse scrollwheel, ignore the Positive Button field, and instead set the Type to Mouse Movement and the Axis to 3rd Axis (Joysticks and Scrollwheel). If your Input Manager still has the default Mouse ScrollWheel input, you can alternatively duplicate this and name it ZoomMoveable.

  • When i click on the paper i want to disable the up movement and the down movement so i created a Player - Constrain in the ActionList Editor, but when i click again i want to re-enable those again, how to proceed?

  • Another such Action can be used to re-enable movement.

    If you want to make multiple clicks to the same Hotspot toggle between these, move this second Action to a new "Use" interaction on the same Hotspot, but keep this new Interaction disabled by default.

    Then, as part of the Hotspot's first Use interaction, use a pair of Hotspot: Change interaction Actions to disable the first Use Interaction, and enable the second Use Interaction. That way, clicking again will result on running the second Use Interaction.

    In the second Use Interaction, you can use another pair of Hotspot: Change interaction Actions to do the opposite - i.e. enable the first Use, disable the second Use.

  • Thanks, i re-enable them again. I have another question, can i change the cursor to a different one when i launch the inventory?

  • The display cursor is set to a pointer but when i launch the inventory i want a different cursor.

  • You would need a custom script that changes the main cursor when the Inventory menu is turned on and off.

    This, placed in the scene, an its Inspector configured with the textures, should do that:

    using UnityEngine;
    using AC;
    
    public class ConversationInventoryInteraction : MonoBehaviour
    {
    
        public Texture inventoryTexture;
        public Texture normalTexture;
    
        private void OnEnable ()
        {
            EventManager.OnMenuTurnOn += OnMenuTurnOn;
            EventManager.OnMenuTurnOff += OnMenuTurnOff;
        }
    
        private void OnDisable ()
        {
            EventManager.OnMenuTurnOn -= OnMenuTurnOn;
            EventManager.OnMenuTurnOn -= OnMenuTurnOff;
        }
    
        private void OnMenuTurnOn (AC.Menu _menu, bool isInstant)
        {
            if (_menu.title == "Inventory")
            {
                KickStarter.cursorManager.pointerIcon.ReplaceTexture (inventoryTexture);
            }
        }
    
        private void OnMenuTurnOff (AC.Menu _menu, bool isInstant)
        {
            if (_menu.title == "Inventory")
            {
                KickStarter.cursorManager.pointerIcon.ReplaceTexture (normalTexture);
            }
        }
    
    }
    
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.