Forum rules - please read before posting.

Enabling/Disabling/Changing Input for Game Mid-Scene

Hi all,

I'm currently developing a racing game. In one scene, the player can drive the car - but then this is suddenly taken away as the vehicle starts to force the player's movement in another direction. However, the player can still look around. I want to give the player autonomy, then take it away from them. It is important for the narrative.

How possible would this be? Could I change input mid-game using AC?

Thanks,
Ryan

Comments

  • edited June 2023

    Hi Ryan,

    you can achieve this by using the "Engine: Manage Systems" Action, depending on how you have setup your Stuff.

    For Example you create a Trigger from the AC Game Editor menu, that disables those Inputs, when the Player drives through.
    You can disable the Player/Inputs with it or enable the "Change movement method" and put it to "none".

    You can also use "Camera: Switch" if you want the Player to have a different Camera during that time.

  • edited June 2023

    Thanks Snan. Do you think I could take it from full gamepad controls to only using say, one of the joysticks? Or would I have to disable ALL inputs i.e. 'disable' or 'none' that you mentioned.

  • edited June 2023

    I can't edit the other comment, but there are seperate enable/disable options for movement, input, camera etc. so those can be enabled in Parts.
    You can also have multiple Players and Cameras and switch to them whenever needed.

    You could have a Player for the Car and another one with different Controls, that you switch to when you want it to change. If you set it to have the old Players Position. I've tried it with my First Person Character and just set all movement values to zero, so i can look around but not move. Something like that could be what you look for.

    In AC Game Editor -> Settings -> Character Settings: Set "Player Switching" to "Allow".

    You'll just have to remember to switch that stuff back. Also using the Manage Systems action, doesn't automatically change back, so you'd have to set your proper Controls at the Start with the "On Start" field in Scene Cutscenes.

    I don't know if that's the easiest way to do it, but you can also always have custom scripting if you are fine with that.
    Maybe someone has an easier way of doing it, because i didn't have to use in my Game.
    But the ones i know would be to switch the Camera and maybe restrain it, or disable certain Inputs or have a different Player.

  • Thanks so much Snan; really helpful advice. I massively appreciate you taking the time. I'll update in this thread if I pull it off.

  • edited June 2023
    Update: I've found that player switching works well, however I am not sure how to change the input settings of individual characters with AC - as Unity’s input settings seem to be project-wide. Instead I'll try the movement settings option.
  • edited June 2023

    If you get stuck, add info about what is happening exactly, how your Project is setup (e.g. what kind of player you use) and what you want to happen in that situation instead.
    Maybe that could help with figuring out what the best way for you would be.

    You are using a different Player Prefab when switching right?
    On that second Player Prefab (depending on what kind of Player you use, and what it's functions are) you can modify certain values or shut them off altogether, to have the Movement Settings you want.

    For example my Player Prefab is First Person, runs around, can jump, duck etc. and in it's Player Script has Movement Settings for walk speed, run speed etc.
    Now, if i copy that and make a second Player Prefab, and in the Settings of this second Player i set movement settings for walking to 0, it stops it from moving and i can only look around.

    You should be able to get away with keeping the Input Settings how they are, and just modifying that second Player, so that it can't make use of those. I think that would give you less to worry about.

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.