#🖱️┃input-system
1 messages · Page 60 of 1
I'm just assuming you have some other logic around whether the gun is ready to fire
like
has enough time passed since it fired last?
does it have ammo?
etc
that wouldnt matter for this though, i just want the keypress but in the new way
//shoot
if (readyToShoot && shooting && !reloading && bulletsLeft > 0)
{
bulletsShot = weapon.bulletsPerTap;
StartCoroutine(Shoot());
}
else if (readyToShoot && shooting && !reloading && bulletsLeft <= 0 && !weaponSource.isPlaying)
{
PlayWeaponAudio(weapon.emptySound);
}``` this is the other logic
i think i understand
yeah in that top if statement you'd do shooting = false
if the weapon is not automatic
or perhaps even inside the Shoot() coroutine
Hey guys! I'm a Unity noob, so this might be a stupid question, but I can't seem to find out how to check for diagonal directions. The tutorial I'm following uses Vector3Int shorthands (right/left/up/down), but I need something for northwest/northeast/southwest/southeast as well.
I thought writing it out like Vector3Int(1, 0, 0) instead of Vector3Int.right would give me the opportunity to use Vector3Int(1, 1, 0) as well, but it gives me the error "Non-invocable member 'Vector3Int' cannot be used like a method.
How would I solve this? Thanks in advance!
new Vector3Int(...)
oh hey it works praetor!
public void OnFire(InputAction.CallbackContext context)
{
WeaponSystem currentWeapon = PlayerStats.Instance.weaponStats;
if (context.started)
{
currentWeapon.Shooting = true;
}
else if (context.canceled)
{
currentWeapon.Shooting = false;
}
}``` one thing: i dont really need to grab this reference every time im shooting
though i dont know how else to get it
@austere grotto I was happy too early.
Even though I created new Vector3Int for all directions, in-game it only picks up the up/right/left/down
wdym
private IEnumerator HoeGroundAtCursorRoutine(Vector3Int playerDirection, GridPropertyDetails gridPropertyDetails)
{
PlayerInputIsDisabled = true;
playerToolUseDisabled = true;
//NorthEast
if (playerDirection == new Vector3Int(1, 1, 0))
{
isHarvestingNE = true;
Debug.Log("NorthEast");
}
//NorthWest
else if (playerDirection == new Vector3Int(-1, 1, 0))
{
isHarvestingNW = true;
Debug.Log("NorthWest");
}
//SouthEast
else if (playerDirection == new Vector3Int(1, -1, 0))
{
isHarvestingSE = true;
Debug.Log("SouthEast");
}
//SouthWest
else if (playerDirection == new Vector3Int(-1, -1, 0))
{
isHarvestingSW = true;
Debug.Log("SouthWest");
}
//Right
else if (playerDirection == new Vector3Int(1, 0, 0))
{
isHarvestingSE = true;
Debug.Log("Right");
}
//Left
else if (playerDirection == new Vector3Int(-1, 0, 0))
{
isHarvestingSW = true;
Debug.Log("Left");
}
//Up
else if (playerDirection == new Vector3Int(0, 1, 0))
{
isHarvestingNE = true;
Debug.Log("Up");
}
//Down
else if (playerDirection == new Vector3Int(0, -1, 0))
{
isHarvestingSW = true;
Debug.Log("Down");
}
I have a cursor which shows where my mouse is and it picks an animation based on the placement of the cursor relative to the player
But it's only reading if it's left/right/down/up and not the combination of two
well it just depends what you're passing in as playerDirection
if you never pass in any of the diagonals they won't be detected
¯_(ツ)_/¯
Although I might not have a clue what you're saying, looking at my code, I have stuff to experiment with
Thanks for your help!
my .WasPerformedThisFrame() is being called twice. Anyone know why?
void GameInput.IPlayerActions.OnInteract(InputAction.CallbackContext context)
{
Debug.Log("Pressed : " + context.action.WasPressedThisFrame());
Debug.Log("Performed : " + context.action.WasPerformedThisFrame());
//NOTE mfragger :: this is being called twice.
if (context.action.WasPerformedThisFrame())
{
OnInteract.Invoke();
}
}
in fact, .WasPressedThisFrame() is evaluated 3 times
well you have two calls in your code
Hello, I couldn't find "Add 2D vector" while adding a new bind. How can I make it appear?
The input action needs to have Control Type -> Vector2
Usually Action Type -> Value, Control Type -> Vector2
i dont understand
Show your input action
sorry but i just started unity so i kinda dont understand things here
@austere grotto
clcik on Movement and show how it's configured in the right panel
then?
then you can add 2d vector bindings to it
With the new input system I cannot have the same button lead to different functions at different times?
you certainly can
I tried adding a second left-mouse click and didn't work.
i want to get it like this
yeah you can do that once you have a Value/Vector2 action
I think they changed the name of it in more recent versions though
it doesnt appear for me
I thought maybe I'd need to have one function that uses bools to tell the input system what function to run.
show how you have set it up
and show what does appear
you can have different input actions in different action maops
and enable/disable input actions and action maps
Tried creating a different action map but didn't work. Hmm enable/disable....
the up leftt right down composite is the same as the 2D vector composite
it was just renamed
oh thx
Oh, it's working now.... ╰(°▽°)╯
Or not. When I changed it a bit I lost the "Player" part to select which function to connect it to. Weird.
I'm guessing I shouldn't be getting these error messages?
what did you do
The normal?
I simply tried to add a new action map with some buttons. Their is another action map with the same button used though.
I wonder if I should just remake my project fresh.
How irrational is an attempt to handle InputActionAsset in a scriptable object? I don't want to generate C# class and instead assign callbacks inside SO using InputActionReference.
Nothing terribly wrong with it, you'll just need a sane way to:
- initialize the callbacks (Awake/Start etc are weird in ScriptableObjects)
- communicate the data to your other scripts that need to use them.
Honestly have you looked into just using InputActionReference directly in your MonoBehaviours? Or Referencing the INputActionAsset directly?
Yes, but it becomes outrageously tedious once I need to use inputs in multiple scripts or swap different input assets.
With SO I can setup all pairs for action name/event and set them OnEnable(). Kinda... Because it indeed occasionally breaks with NullReferenceException in binding.
A singleton MonoBehaviour might be easier because the lifecycle events are more predictable. I believe Awake works for ScriptableObjects but only in build, not in editor.
Huh, you are correct. I never noticed that SO OnAwake debug message doesn't show up in the console. Probable I can call this part manually using EditorApplication.playModeStateChanged callback.
Hi how would you do if (Input.GetButtonDown("Jump")) in the new input system
.wasPressedThisFrame? Or a callback on .performed binding.
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.3/manual/HowDoI.html
So would I then have to type both the controller thing and the keyboard thing? Thanks.
If you want to do away without the Input Asset and support both devices, then yes.
Hmm I'm sorry but I don't quite understand would it then be if ( Keyboard.current.space.wasPressedThisFrame && Gamepad.current.aButton.wasPressedThisFrame){jumpBufferCounter = jumpBufferTime;}else{jumpBufferCounter -= Time.deltaTime;}
the debug.logs?
One is Pressed and the other is Performed.
I tested both, and both methods get's called and evaluated multiple times
here's the sanitized code.
void GameInput.IPlayerActions.OnInteract(InputAction.CallbackContext context)
{
Debug.Log("Pressed : " + context.action.WasPressedThisFrame());
Debug.Log("Performed : " + context.action.WasPerformedThisFrame());
}
and here's the result.
further sanitizing the code.
this code:
public void OnInteract(InputAction.CallbackContext context)
{
if (context.action.WasPerformedThisFrame())
{
Debug.Log("Called");
OnInteracted.Invoke();
}
}
evaluates the .WasPerformedThisFrame() twice
Nope just once. If that prints twice the whole method is running twice
which means you've registered it twice somehow.
how did you register it?
.WasPerformedThisFrame is called twice.
In my project, it seems like controller input is only processed when I'm in Game view. I would like to process input and move my character while in Scene view, is it possible to enable controller input in Scene view?
Of course not unless your game requires to press space and A button at the same time. wasPressedThisFrame returns true only if the button on the given device was pressed during the current frame.
for some reason my inputs are being weird? Im using InputSystem
if I hold W my character sometimes moves upwards after you regain control once he does its normal walk-in animation, but sometimes they input doesn't register until I hit another WASD key like D, which then makes W work. Is there a way to fix this? Just always return which buttons are being pressed when a map is enabled?
please share more relevant code.
What is HandleInput? directionsHeld? LerpInput? Where's the actual movement code? The code you showed just raises a lot of unanswered questions 😵💫
I can I thought it was more the input system itself bc of the wierd behaviour, but it might be my code
I can show handleinput if you want but it shouldn't be relevant bc it doesn't have any movement code
I just didn't want to dump too much on everyone
here it is
sorry had to do some file digging
Can you please share code via a paste site, as per #854851968446365696
I'd rather not have to download a file to read it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
how can i rebind a composite binding?
Anyone have a barebones tutorial laying around for unity's new input system? I've used like 6 tutorials, and im still stumped on how to use it, haha
In the package manager you can import practical examples of it.
!! thank you! I didn't think about that
Anyone know how calling the OnCancel event works with the Input system UI input module?
I tried using in in a script on the UI canvas but it seems to never be called. Here is that script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.InputSystem;
using UnityEngine.EventSystems;
public class ControlScreen : MonoBehaviour, ICancelHandler
{
public GameObject basicsSlide;
public GameObject buildingSlide;
public GameObject controllsSlide;
public GameObject loadingSlide;
public Button next;
private int count = 0;
public void Progress()
{
switch (count)
{
case 0:
basicsSlide.SetActive(false);
buildingSlide.SetActive(true);
count++;
break;
case 1:
buildingSlide.SetActive(false);
controllsSlide.SetActive(true);
count++;
break;
case 2:
controllsSlide.SetActive(false);
loadingSlide.SetActive(true);
loadLevel();
break;
}
}
public void loadLevel()
{
//SceneManager.LoadScene("Level1");
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
public void OnCancel(BaseEventData eventData)
{
Debug.Log("CANCEL CALLED");
}
}
Hey folks, can anyone help me with Rebinding A composite binding with the new control system?
inputAction
.PerformInteractiveRebinding(_bindingIndex)
.WithControlsExcluding("Mouse")
.WithBindingGroup(bindingGroup)
.WithCancelingThrough("<Keyboard>/escape")
.OnMatchWaitForAnother(0.1F)
.OnCancel(op => CancelRebinding(op))
.OnComplete(op => RebindComplete(op))
.WithExpectedControlType("Button")
.Start();```
Error:
```InvalidOperationException: Cannot perform rebinding on composite binding 'MovePlayer:2DVector(mode=2)' of 'Gameplay/MovePlayer[/Keyboard/w,/Keyboard/s,/Keyboard/a,/Keyboard/d]'
UnityEngine.InputSystem.InputActionRebindingExtensions.PerformInteractiveRebinding (UnityEngine.InputSystem.InputAction action, System.Int32 bindingIndex) (at Library/PackageCache/com.unity.inputsystem@1.3.0/InputSystem/Actions/InputActionRebindingExtensions.cs:2763)
RemappableBinding.RemapBinding () (at Assets/Scripts/RemappableBinding.cs:73)
private PlayerInputActions playerInputActions;
that line is giving me error but i have that with that name
Assets\Scripts\Player\Movement\PlayerMovement.cs(10,13): error CS0246: The type or namespace name 'PlayerInputActions' could not be found (are you missing a using directive or an assembly reference?)
I renamed that PlayerInputActions it was just PlayerActions before maybe it created some problem?
is it because my script is in a different directory?
how do i do it then?
Ok so, i created a new InputActions called PlayerInputActions.
private PlayerInputActions playerInputActions; but this is giving me this error :
Assets\Scripts\Player\Movement\PlayerMovement.cs(10,13): error CS0246: The type or namespace name 'PlayerInputActions' could not be found (are you missing a using directive or an assembly reference?)
The InputActions file is not in the same folder as my PlayerMovement script. Is that the issue? and how to fix it
Did you check the box on your input actions asset to "Generate C# script file" or whatever it's called?
its off
well... turn it on?
hello using the input system but i cant seem to find a way to show some of the drop down menus for path in this screenshot i installed the package + all the additional plugins to the package can someone help pls.
PS : Pls ping / I'me in France rn so it's 01:41 so I wont be able to answer you but thanck you for the time you took to reply to me
what are the path's that you're trying to get but don't show up in the drop down? I think it usually filters what paths it considers valid based on the action type in your composite binding (the ZQSD line). If it's button vs axis vs stick, etc. Try messing with that and see if it solves your problem.
I’m using vect2 analog
► ANIMATIONS
https://drive.google.com/drive/folders/1j2HicZMabg4h2Oe8ocxGNuKBHY5kzFJA?usp=sharing
► PLAYER MODEL
https://drive.google.com/drive/folders/1X6DLqSsLT2EAIYpcZGYL-Z93hYOo2sxa?usp=sharing
► EPISODE TWO
https://youtu.be/c1FYp1oOFIs
► SUPPORT ME ON PATREON!
http://www.patreon.com/SebastianGraves
► ASSET STORE PAGE (Animations & Model...
I'm following this tutorial and 3:35 i dont have this dropdown menue or others
can someone help pls ^^
you mean the dropdown with where you can assign wasd?
when you have the action check if it is a value and a vector 2
then right click it and select up/down/left/right composite
this should be good for wasd movement
I have a small question myself, i am using a generated script for my inputs and would like to know how i can make a function to get the current control scheme via the generated class
I can see you can read an array with controlschemes but i can't see if it's possible to get the current one from it
I have a 3rd party usb "playstation" controller that i created a Gamepad control scheme for. It works fine for the buttons but i can't make it work with the sticks. I tested that my controller works in an online html5 gamepad tester - so it's not broken.
I created the movement to be a Value/Vector2 type and it works fine for my keyboard scheme. for the gamepad i tried binding the path to left stick, right stick - i tried the generic gamepad, the playstation 2 controller and even the webgl gamepad and it picks up nothing. I try to debug out ReadValue<Vector2> as well as ReadValueAsObject - both axis stays at 0,0. Then i opened the Analysis/Input Debugger and it won't show any input from the controller - not even the buttons that actually work in-game. Does anyone else have or have had this problem?
Have you split your project into multiple assemblies? I sounds like the assembly your PlayerMovement is in needs an assembly reference to the assembly that your PlayerInputActions is part of. Also you could move the created file (or change the location in the properties) so the file is placed in your Scripts folder and not in the Samples folder
Did you check to auto create the c# file from your input system file?
no i didnt had that but i have it now
Yes this work but like I can’t access the different key bindings
In path in this image @stark notch
Press that T symbol near it
Yep doesn’t work no list
Maybe you need to reinstall it not sure what the problem is
How do you get cursor position during click?
basically I have this
and I simply want to get cursor position during this action
asnwered you already in #archived-code-general
but, is that the correct way?
With New Input System?
give it a try
that seems like old input method
not much of a difference
but is there a intended way of getting cursor pointer position with button action type?
Button action type doesn't make sense for cursor position
So I came up with this
You should use Action Type: Value, Control Type: Vector2
yeah
When i run my game in the editor i can use WASD to move plus , and . to shoot. When i do a webgl build - only the wasd keys are working - could this be because i'm using a nordic keyboard?
maybe O.o
Does anyone have experience with webgl keyboard layout problems? am i confined to use a-z keys only if i want it to work on a webgl build?
why does this says left stick/down?
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Gamepad.html
this just says left stick and what is the "down" supposed to be
the down is the "downwards" portion of it
it will register if you tilt the stick down
uhm ok gotcha, anyways found the left stick, thx
Why dont i have this dropdown menue pls help
is the processor for left stick/direction to make it not move by itself this one?
click on path ( on the button on the side)
but in the vid it doesnt have a processor thing
uhm? the processor is just for my problem
click here
yes i know i did it doesnt show anithing
ok
well when i click on it nothing happends
@fallow vine any ideas ?
nothing
ok thx ^^
did the OnDeviceChange method get replaced with OnControlsChange or is it 2 different things?
I'm having a weird behaviour with my UI Elements on mobiles.
In order to press a button multiple times I have to move the cursor at least 1 pixel. But if the mouse remains in exact same position it doesn't work.
maybe uninstall the input system and install it again or delete your libraries folder so unity rebuilds that idk if it does anything
Done nothing
I have no idea really but maybe you can record a small video showing what you can do with a new input action asset where you try to set it up as much as possible
This could maybe help give an indication to how exactly it isn't working as intended
hola folks, i have an input action with 2 interactions, hold and press, id like to check for it with the callback context but its only firing the first interaction, am i misunderstanding?
I'm trying to use mouse delta, I'm assuming it returns change in screen pixel position, but that doesnt seem to be the case. am I missing something?
I'm reading something about 'accumulation' in the manual but i cant make sense of it
I dont get why its not the actual position delta
Is there a way to update the value of a Sensor, specifically the StepCounter, manually for debugging?
it does
probably just need to reorder the interactions
anyone know why unity text input keeps reactivating itself after I call DeactivateInputField()?
it deactivates for about a second, then auto focuses
Can i somehow get the current input device without a player input component using a generated class?
I am using a scriptable object for my input system so i can easily have one instance on every object that needs it
so i would like to leave the playerinput component out
It doesn't.
it does
Lol
If I add up all the deltas as I move my mouse from left side to right it's always more
Or if I add the Delta to a UI element it doesn't follow the mouse, it's like 2x
But if I use mouse position it works
I've tried polling and events, I've tried changing the input system updates, it's never accurate
I'm new to unity but I remember from a tutorial about clicking and dragging that u have to take in account the canvas scale factor for mousedelta
I did
Ok sorry
No worries thanks
however i seem to order it, it seems only the first one is sent to my event
I'm using the Delta for camera rotation using mouse or touch, and I've noticed the sensitively is wildly different depending on device. So trying to get to the bottom of how it works
the first on will be activated first of course, if you hold down longer the first one will be deactivated and the second one will be activated instead
ooh, should i be using tap instead of press perhaps?
? the behaviour will still be similar
well press only gets deactivated when you let go though no? so hold will never start while its active
I am using the new input system rn with the intent of adding local multiplayer, however when I spawn in all of my prefabs, the controllers control each other (and themselves) instead of their own prefab. I have turned off auto switching (even with it on it does it), I have set any movement variables to private (idk if that affects each other) and setup the controller schemes. Any images needed I can send them, movement code is very basic.
Make sure you're acting on the last delta per frame. If you're using callbacks you're seeing deltas as they accumulate, which is rarely useful.
i dont quite understand how i do that
private Vector2 _look;
private Vector2 _totalDelta;
public void OnLook(InputValue value) => _look = value.Get<Vector2>();
private void LateUpdate() => _totalDelta += _look;
To be clear, I don't know what your setup looks like, so this might not be the issue.
This is just how the Starter Assets handle it, and one of the things the input system devs were talking about when I was complaining to them about the Starter Assets 😛
Also make sure the settings are set to sample in Update and not Fixed Update
done
Hrm, no idea then, sorry
public class TestInput : MonoBehaviour
{
[SerializeField]
private InputActionReference look;
[SerializeField]
private Vector2 delta;
void OnLook(InputValue value)
{
delta = value.Get<Vector2>();
// transform.localPosition += (Vector3)vector;
Debug.Log($"OnLook {delta}");
}
void LateUpdate()
{
transform.localPosition += (Vector3)delta;
Debug.Log($"LateUpdate: {delta}");
}
}
i should rule out that the localPosition isnt the cause, but when i set it to pointer position its fine so
What are you expecting to happen here? Is your camera set up to replicate screen space?
yes this script is just on canvas image for testing
a non-scaled canvas?
yes
ill make a new setup that uses only the pointer position to compare against to rule out any canvas silliness
looking at the logs, i never see any accumulated deltas either
Ok so comparing it to position, its wrong
'calcDelta' is just (position - previousPosition)
and delta is from the input system
public class TestInput : MonoBehaviour
{
[SerializeField]
private InputActionReference look;
[SerializeField]
private Vector2 delta;
[SerializeField]
private Vector2 position;
[SerializeField]
private Vector2 previousPosition;
void OnDelta(InputValue value)
{
delta = value.Get<Vector2>();
// transform.localPosition += (Vector3)vector;
Debug.Log($"OnDelta {delta}");
}
void OnPosition(InputValue value)
{
position = value.Get<Vector2>();
Debug.Log($"OnPosition: {position}");
}
void LateUpdate()
{
var calcDelta = position - previousPosition;
previousPosition = position;
transform.localPosition = (Vector3)position;
Debug.Log($"LateUpdate: delta {delta}, calcDelta {calcDelta}, position {position}");
}
}
if you look at the highlighted log, it should be (9,-1), but its reporting (12, -2).
heres a more clear example using Update:
if im not using it as intended, someone please enlighten me
Is your game view at 1x zoom?
yes
i also tried adding up all the deltas as a dragged my mouse from left edge to right, and it didnt match the screen width
im giving up on this, im going to use the position input and calculate my own delta. but im convinced its either broken or too confusing to be useful
for reference im using input system 1.1.1
why is there no "Add 2D Vector Composite"?
Change it from button to value maybe idk
I´ve got this setup (following Dark Souls series from Sebastion Graves). Y doesn´t trigger ingame, instead I must click Z.
I´ve German as system language.
Any idea how this can be solves. It seems like y and z are switched.
Thanks
Uh I need to create controllers (left-right buttons + jump button) for my mobile game, but idk how to create those. All I can find are tutorials for joystick input. Can anyone help me?
`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class InputManager : MonoBehaviour
{
private PlayerInput playerInput;
private PlayerInput.OnFootActions onFoot;
private PlayerMotor motor;
// Start is called before the first frame update
void Awake()
{
playerInput = new PlayerInput();
onFoot = playerInput.OnFoot;
motor = GetComponent<PlayerMotor>();
}
// Update is called once per frame
void FixedUpdate()
{
//tell the playermotor to move using the value from our movement action
motor.ProcessMove(onFoot.Movement.ReadValue<Vector2>());
}
private void OnEnable()
{
onFoot.Enable();
}
private void OnDisable()
{
onFoot.Disable();
}
}
`
`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMotor : MonoBehaviour
{
private CharacterController controller;
private Vectore3 playerVelocity;
public float speed = 5f;
// Start is called before the first frame update
void Start()
{
controller = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update()
{
}
//receive the inputs for our InputManager.cs and apply to our character controller
public void ProcessMove(Vectore2 input)
{
Vectore3 moveDirection = Vectore3.zero;
moveDirection.x = input.x;
moveDirection.y = input.y;
controller.Move(trasform.TrasformDirection(moveDirection) * speed * Time.deltaTime);
}
}`
Why are you telling me this?
Because there's no such thing as Vectore2, you want Vector2. Note that you have an E extra
ooooo i'm very stupid thk man
is there some info maybe on if they plan on improving some things of the input system in the future
I would like to get the current control scheme without having a player input component but can't find a way to make it possible right now
Control schemes are part of https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputActionAsset.html
ah thnx
yeah, but i can't figure out how to get a control scheme that is currently in use through that
with playerinput you can i think use an event it invoked but i want to avoid it
InputControlScheme GetScheme(InputAction.CallbackContext context)
{
foreach (InputControlScheme scheme in _gameInput.asset.controlSchemes)
{
if (scheme.SupportsDevice(context.control.device))
{
return scheme;
}
}
throw new System.Exception("Could not get control scheme from context " + context.ToString());
}
This is the script someone showed me but it doesn't work for the keys on the keyboard then it doesn't return anything
Any idea how to make it work for everything?
if an input changes i'd like to know the control scheme the input likely was part of
Then i can make my aim system depend on a mouse or joystick for a top-down shooter
never mind i think i did get it to work
'Y [Keyboard]' in Unity input means "the key position that would produce 'Y' on a US English keyboard". If you're using, say, a QWERTZ keyboard that key will have a 'Z' printed on it instead, but as far as Unity is concerned it's still the same key.
Why does it happen
NRE is always the same. You're trying to use a method or field from a null reference
???
Something x = null;
x.anything << this causes the error```
Figure out which thing is null, why it's null, and fix it.
Ik that much
I have no clue why it's nu tho
What is "it" that is null, and how are you assigning it a value. Start there
You might have a serialized field that isn’t filled in
im still somewhat new to this system so
private InputAction Fire; //player jump command
public float damage = 10f;
public float range = 1000f;
public float firerate = 1.5f;
public float spread = 10f;
private bool shooting;
public Camera fpscam;
private void Awake()
{
playercom = new PlayerControls();
}
private void OnEnable()
{
Fire = playercom.PlayerCharacterActions.Fire;
Fire.Enable();
}
private void OnDisable()
{
Fire.Disable();
}
// Update is called once per frame
void Update()
{
shooting = Fire.ReadValue<true>
}```
how can I make it so I can hold down the button to continue shooting?
rather than just tapping the button
I can't find out how to make it fully automatic
it'd be bool shooting = Fire.IsPressed(); in Update
Ah
but you'll need to actually write some code to handle the shooting after that of course...
i know like raycast damage etc
well obviously that, but I mean code that will ensure the gun fires at the correct firerate etc
all of it
oh yeah that too.
Thanks. Yes, I got that and I´m using Z for now, so I can press Y on my QWERTZ keyboard. So there´s no way / setting in Unity for QWERTZ keyboard?
Switching these two keys is easy, but I´m not sure if other things are different?
Hello !
Is there a function in the Input System to know if a binding is already attached to an action (and that return this action) ?
There's a FindBinding here: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.3/api/UnityEngine.InputSystem.InputActionAsset.html
Hey.
Im using the UI Event System Input Module to navigate UI with inputs. Im also using a ToucheZone for my Character Movement. Its the StarterAssetsInputs Touch Zone for mobile from the Unity Asset. https://forum.unity.com/threads/say-hello-to-the-new-starter-asset-packages.1123051/
The thing is.. every inputs gets recognized from my UI / Navigate Event System except the TouchZone. I've already tried to set something up in my input actions but i couldnt find anything that would fit.
So how can the Input System UI Module can pick up my TouchZone as direction input for UI navigation?
Is this a screenshot from your project? Shouldn't you use your own actions asset instead of the DefaultInputActions there?
well the default one immediately worked with every input ive set up in my input actions
Does anyone know why i cant select gamepad right stick?
nvm I figured it out i needed to change the action type
You're setting up a binding for a button. The "Right Stick" binding is a pair of axes, you can't press a pair of axes; if you want to bind something to clicking the right stick, choose "Right Stick Press".
The default one isn't your input actions at all, it's a premade one
Hey, is there a way to override an action with "no input" ?
When using action.ChangeBinding(0).Erase();, it seems that I won't be able to find the base value
Hi, whenever I reload my scene with scenemanager.loadscene and I press start to open up the UI, I get this error message:
MissingReferenceException while executing 'performed' callbacks of 'UI/Pause[/XInputControllerWindows/start,/Keyboard/escape]'
UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>c__DisplayClass7_0:<set_onUpdate>b__0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
Any help on what exactly is the missing reference and how can I avoid this error?
Sounds like you're subscribing to an action and not unsubscribing when your object is unloaded
And what is it?
what is what
Thanks, going to check it out 👍
m_wrapper
you tell me. it's your code
Or I'd gather it's probably the auto generated code from an InputActionsAsset?
show your PlayerMovement script
show the whole script
you can't do that:
movementActions = new InputActions.MovementActions()
Do this:
InputActions inputActions;
void Awake() {
inputActions = new InputActions();
}
// later...
if (inputActions.Movement.Jump.triggered)
or it might be inputActions.MovementActions - whatever you named it
Now there's no error but it doesn't work still
that's a whole other issue 😛
you also need to do inputActions.Enable(); at some point
why would there be any "slip"
the new input system doesn't have any built in "momentum" to the axis values the way Input.GetAxis() had. It behaves like Input.GetAxisRaw
yes
it's not there in the new system
it's quite easy to replicate if you really want it
Vector2 move;
float axisGravity = .5f; // configurable
void Update(){
Vector2 target = < that whole big line you have right now for "Vector2 move = " >;
move = Vector2.MoveTowards(move, target, Time.deltaTime * axisGravity);
controller.Move(move * (speed + speedOffset) * Time.deltaTime);
}```
Idek what's it supposed to do and there're clearly a couple errors xD
What was it supposed to do..?
you were not meant to include the < > verbatim...
nor the text "for "Vecto2 move ="
I was just saying put your existing code there
it will add momentum to how you process the input, same way that GetAxis used to do it
Oke
Now it works
But very weird
It works like I wasn't multiplying it by transform.right/forward and it's hard to start and stop walking at all xD
show the code you ended up with
oh it;'s a Vector2/Vector3 problem
Sorry I wrote Vector2
should be Vector3
in all places
Still the same
no way
you probably missed a spot
did you make move a Vector3?
Vector3.MoveTowards?
Vector3 target?
Oh yea move
Now it is relative to the rotation but it's still very hard to start or stop walking
we're kinda mixing up the input with the movement vector itself. Try this:
Vector2 input;
float axisGravity = 0.5f;
void Update() {
Vector2 target = new Vector2(movementActions.LeftRightMovement.ReadValue<float>(), movementActions.ForBackMovement.ReadValue<float>());
input = Vector2.MoveTowards(input, target, Time.deltaTime * axisGravity);
Vector3 move = transform.right * input.x + transform.forward * input.y;
controller.Move(move * (speed + speedOffset) * Time.deltaTime);
}```
have you tried adjusting the axis gravity?
Yep
hey all. im trying to get 1.4.0 into my project (I'm on 1.3.0) and running 2021.3.1f1 version. but i just cannot get the package manager to see the pre-release package in package manager to update it... any thoughts?
i really want to use the "exclusive modifier" fix in 1.4.0.
Has anyone ever had this? I tried switching branches with Git and now NOTHING works anymore. NO branches. NONE
you can't do that. if manually referencing the desired version does not add it, it is most likely less than incompatible with the unity version. the only possible way would be to manually add it to the assets folder
hm. i bet it's that unity is feeling incompatible. changing the manifest.json to 1.4.0 doesnt do anything. dang.
so you could at best add it manually
ill try that. just download the source code for 1.4.0, and then do "add packlage from disk", and select folder right? never done this, but this is what im gonna follow: https://docs.unity3d.com/Manual/upm-ui-local.html
well, i did finally get 1.4.0 in (manually imported it from downloading source code) and it has fixed my issue. 🙂 thanks for some tips in there.
I don't see any mouse related code here. For the joystick code it seems like you're just using absolute axis directions (Vector3.forward and right)
Your ground plane stays at 0 0 0 that's why it's rotating wierd
if you wanna move the camera you should move the plane with it
You raycast at the plane, but the camera moves under the plane
yeah what @glad steppe said is right - you should use the position of the ground in the current arena instead of Vector3.zero there
gotta love how there's an entire chat dedicated to the complexity of the input system package
I think it's mostly to keep the same input questions out of the other chats ^^
In Unity3D Ive got this player controller, but it seems to only create a zero vector, does anyone know how i could fix this?
Might be a silly mistake but is your speed variable set in inspector? I like to set defaults in my declaration because I've made that mistake so many times
I've got a problem, The input system doesn't work with unity remote 5 for some reason
What version? Versions of Input System before 1.4.0 don't support Unity Remote.
nvm, i just rewrote the entire input system to make it work
took a while but its very customizable
That isn’t the issue, I set it at runtime to prevent this issue.
It's documented that it's not supported.
Oh nice to know they added support
Yeah, literally only released in the last couple of weeks I think. It might still only be available direct from the github repo.
okay so i am pretty familiarised with unity but my keyboard input does not register and only my mouse does
i used Input.anyKeyDown to check my theory
is there anything from stopping it from working
maybe you need to click on game view to give it focus?
Does anyone have any tips on creating a back button with the Input system UI input module? I want to create a method that will be called when a back button is hit that I can make switch to the previous scene. I tried using ICancelHandler and the OnCancel(BaseEventData eventData) event but it never seems to be called. And I'm not sure how to override the basic Input System UI Input module functions.
what's the best approach for input actions that only work when the event system reports the pointer is over the "background"?
the objective is to create an input action reference i can drag and drop into cinemachine input provider
which correctly (1) orbits the camera (a pointer delta action) (2) when the button press started over the background (3) as long as the button is pressed
otherwise i guess i can override methods in cniemachineinputprovider
is there any way of getting an action's control type, without allocating GC memory as .ReadValueAsObject(); does?
I wonder if you're trying to inject too much "smarts" into the input system. its job is to read input from input devices. it shouldn't care about things in the game like event system. That's for your user logic to disentangle
Anyone here has experience with Keijiro's Minis (MIDI input)? I'd like to control parameters with a midi knob but I can't find any resources
I'm a Unity beginner so I'm a bit lost
i am modifying the input provider from cinemachine instead
i fixed this by using a recent unity version, thanks for the help tho :D
Is there any reason to use the new input system over the old one if I only plan to support pc?
Yep for all the reasons the new input system exists:
- option for event-based input handling
- better local multiplayer handling
- better device swapping handling
- runtime rebinding support
Thanks. Is there an article on doing runtime rebinding?
is it possible to get the action by its name even thought there are 2 actions with the same name in different action maps? PlayerInput.actions[actionName] ^this will return the first action found, even if its action map is disabled
you can do actions["mapname/actionname"]
didnt know that, ty
can someone help me with this https://pastebin.com/Xqbezm8a
i used WasPressedThisFrame() to get the exact frame a button was pressed down but what happens is if i hold the button down WasPressedThisFrame() always returns true for every frame the button is held down which is not what i want (basically I want the old Input.GetKeyDown() functionality)
ok i get it now, onActionTriggered gets called on press and on release so it only updates the bool during those times
yeah wass gonna say that doesn't make sense
Hey everyone for some reason i dont have an input actions button any fix to that pls??
What button are you referring to
To create input actions , i installed the input system but not sure how to open the interface
This one
This is a video on youtube
Ive seen a few and they all say create > input actions
Its on the very bottom my bad
Hey guys! I'm not friends with the new Input System yet. I'm trying to create a four way attack system based on the right stick and I want to animate the attack based on the input on the stick. Because it's humanly impossible to always push the stick 100% straight, I tried to play around with the deadzone and the input values to make sure the right animation plays. It still doesn't seem to work perfectly.
Does anyone know how to go at it the right way?
Use the "digital normalized" processor
Is that the same one as the normal normalized?
oh wait, I have to change the control type
Got it working @austere grotto, thanks mate ❤️
Can anyone please help with this i cant make an input action system
seems like there's a graveyard of very similar questions, but is there any way to get a switch pro controller working w/ the input system on mac, so that it doesn't continuously spam input?
👀
Is there a reason that InputSystem.XInput does not exist? I am trying to query the device type as "InputSystem.XInput.XInputController" but I am getting an error that there is no definition for XInput in InputSystem even though it very clearly shows in the documentation here: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.XInput.XInputController.html
Actually, it seems it only works if I add the namespace rather than trying to call it directly, which is a bit odd but I guess it works okay for what I need it for
i fired up my project today and the input system decided it doesn't want to work. my onActionTriggered callback is not being triggered at all. also noticed the player input object does not assign me a device nor a control scheme
somehow, the solution was to plug in a controller
otherwise the user is not assigned a device and control scheme
is there a way to prevent the editor input devices from attaching
when entering play mode
by default it seems there are devices and no user, and then when i add a device paired with a new user, i get these unassociated devices + proper user
i would rather have no devices, and then proper user
heya people, i made roll-a-ball in the unity editor and it worked flawlessly, built it and nothing wants to work
why 😃
can I check the version of the input system thru code?, like
#if INPUT_SYSTEM_VERSION 1.3.0
you can use an assemblydef's scripting define
which supports the version numbers
Anyone know why my Inputsystem will randomly break? I have done nothing to it's script (honeybee.cs) but it decided to have a full melt-down; this happened once before with once again, no input from me; and the way I had to fix it was simply destroying and remaking the whole thing from scratch; which I'd like to avoid doing a third time haha
oh nevermind, turns out the problem was I had moved the script to my Scripts Folder, apparently the inputActions file and the script need to be in the same folder or the input actions just duplicates it when exiting playmode
normally I'd delete my message but figure I'd leave it here incase anyone comes across this issue
guys i am starting to learn new input system
any good tutorial you guys recommend , actually i need architecture of input system so i can understand how its work , even flow chart also work
guys how can i use custom ui as input for the input system
What do you mean by "custom ui" ?
If you mean like a joystick, there's one given by the input system
that you can attach to an action
Hi, I have kind of a dumb problem.
Im trying to set up multiplayer with the "Player Input Manager" Component
however the Player is not spawning when the join action is triggered
and there are no errors in the console
this is my PlayerInputManager Component:
Hello, I don't receive the input system message.
I expect that when I hit ESC button, it will trigger the following method.
It's currently not happening, I tried if I receive other events from the system and I do in that script. What could be the issue of not receiving it?
private const string DEFAULT_CANCEL_BINDING = "<Keyboard>/escape";
private const string DEFAULT_EXCLUDED_BINDING = "<Keyboard>/NULL";
var excludedBindings = new[] {DEFAULT_EXCLUDED_BINDING, DEFAULT_EXCLUDED_BINDING, DEFAULT_EXCLUDED_BINDING};
cancelBinding = DEFAULT_CANCEL_BINDING;
_rebindingOperation = inputAction.PerformInteractiveRebinding()
.WithControlsExcluding(excludedBindings[0])
.WithControlsExcluding(excludedBindings[1])
.WithControlsExcluding(excludedBindings[2])
.WithCancelingThrough(cancelBinding)
.OnMatchWaitForAnother(0.1f)
.OnCancel(operation => RebindingComplete())
.OnComplete(operation => RebindingComplete())
.Start();```
Im using this code to rebind an action binding, but i found out that the E key cancels the process, and i cant figure out why
I recall reading that the E key in input system had weird problems, could be relevant
https://forum.unity.com/threads/input-system-rebind-not-detecting-single-key.1224747/
Hello guys, my on-screen stick is always zero. It is not returning any value. It is binded with left stick and while controller is giving normal value the on-screen stick doesn't work. I also read that people are complaining that 1.1.1 , 1.2 and 1.3 of the new PlayerInput system versions are broken when it comes to the on-screen stick. Is that true?
You'd have to show your setup and your code. I'm not aware of any systematic brokenness
I know this is probably asked a thousand times, but is there a built in controller vibration function? Or do I need a third party for that
There is support for haptics and rumble in the input system
im having an issue with a ps4 controller where its stuck moving
anyone had a similar issue?
Whats the best approach for making a button accept a right mouse click using the input system (not the old input manager)? Im having issues wording what exactly what i need in order to get appropriate search results online... Basically I want a button to accept both left and right mouse in order for it to do different things on each event.
you add a script to it with IPointerClickHandler
and you can read which click it was from the PointerEventData parameter to your OnPointerClick function
it's not really an input system issue at all
assuming you're talking about a UI Button?
This is a #📲┃ui-ux question
thank you
hello, would u know the answer to my question ?
@whole lightbecasue you need to change the text size then rescale it. i cant remember what way round works well. or just use TextMeshPro
my project has just stopped using my xbox inputs completely when i didn't change anything about the input settings. works fine in my other projects
tried a bunch to fix it and im left with creating a fresh project unless sombody knows why that may happen?
Does anyone have experience making games in split screen?
I want to make a fun little project for my friends and I, and would like to have keyboard controls for one player and controller for the other. Would it be as simple as having a player one and player two prefab, each with the right controls assigned?
usualy yes,
once u get used to it, but if like me unity has just decided to ignore controller inputs for no reason i can see, can get a bit tricky lol
Has your issue happened after you changed something?
even if its not relevant to your inputs
well like i said, no reason i can see
are you making sure that you've referenced all the right events or enabled all your controls?
it was working ive been making a digger game with this project i copied the inputs from another project, and nothing about the input system changed because i wasn't touching it.
are you 100% certain you installed the same version of the Input system?
and that it's enabled in the project settings too
its the old input system
and its been working fine in everything up till about an hour ago
well this is a massive waste of time
Ahh, i see. I've got no clue about the old input system. I never figured that out
well its usualy quite simple
well i was hoping to have this game ready to test in week, now il probls spent more time on this than i did making the rest of the game so far
yup still wasking time, with a fresh project it works fine but then when i bring my old stuff into it it stops working. even if leave the Input table the same. so Somthing is messing it up but in 5 years of using unity. Ive neaver seen or heard of anyhting that would do this
Correct. I had tried something similar but not with IPointerClickHandler. I THINK I used OnPointerClick which might be for input manager
Those are the same thing
OnPointerCllick is the method defined in the IPointerClickHandler interface
Oh. I see. Then im not super sure whats up because it wasnt responding last i tried
I also have a script with OnPointerEnter in it on the same button, ill remove tht and try again later
i just tested it and it works! I had used OnPointerDown not click..
the highlighting etc effects don't work with right click it seems ,but i think thats a nonissue considering what i want to use this function for. Thank you for the pointers 😊 (no pun untended)
How do I get scrolling up/down?
Hi, anyone could tell* why is this error dropping? Input Key named "" is unknown, when i literally have the input key there?
GetKey uses keys
GetButton and GetAxis use axis names
poopKey is an axis name
Thank you!
do somebody knows how to recreate an OnButtonDown with the new input system? It's been hours I'm searching for solution but I've found nothing yet and the fact that there are no simple solutions sounds very strange..
I'm trying to use .started but its NEVER true
can you show the code you are trying?
I dont know if this is the right place to be but for UI's using sliders and buttons with keyboard navigation and controller navigation, how can I make it so that the keyboard and controller can actually use the slider because currently it can just highlight them and doesnt do anything else, like i cant press anything to select the slider to slide it or anything and im just wondering how i can get that to be a thing
Using new Input System, I can't make my movement be detected by my left stick on my controller. It works perfectly fine for WASD but for the controller it can't read joystick input.
Here is the script that moves the player(movedelta is a vector3)
This works fine with vector2 but it's really important for the rest of my script I use vector3 for movement
I spent around an hour searching for solutions online and got nothing, any help would be really appreciated
I don't want to use a system like WASD for left stick up left stick down because it doesn't have the precise left stick rotations I need
hi
i have this piece of code in my script
public Input input;
but i dont see it in the inspector
btw input is the name of my input actions
pls help me
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Main : MonoBehaviour
{
public Input input;
private void OnEnable()
{
input.Actions.DropBall.performed += DropBall;
input.Actions.DropBall.Enable();
}
private void OnDissable()
{
input.Actions.DropBall.performed -= DropBall;
input.Actions.DropBall.Disable();
}
public void DropBall(InputAction.CallbackContext context)
{
Debug.Log("drop");
}
}
```this is the whole script
With the new input system how do I make an empty game object move depending on mouse position? I plan on using the empty game object as a source object for multi aim constraint but I can't find a way to essentially store the mouse position in an empty game object with the new input system
Try to Google something like how to get mouse position new input system
And then just move the go
screenshot your console
thats not the inspector, i dont know what that picture is trying to show
I get an errir that the input is not set to any thing
screenshot
Im not on pc rn
and screenshot the inspector too
... get better
It's like 2 am rn for me
ok so? its 2am for me too
what is Input? show the file
.
do u need the script too?
its generated throught the input thing tho
you have compile errors, its not going to update the inspector
so i should do something like this? ```cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class Main : MonoBehaviour
{
public Input input;
/private void OnEnable()
{
input.Actions.DropBall.performed += DropBall;
input.Actions.DropBall.Enable();
}
private void OnDissable()
{
input.Actions.DropBall.performed -= DropBall;
input.Actions.DropBall.Disable();
}/
public void DropBall(InputAction.CallbackContext context)
{
Debug.Log("drop");
}
}
try it and see
i dont get any errors but i still cant see it in the inspector
you should just have this sort of class:
and assign the things in the events from the inspector
so i need player inpt component?
input*
sorry if im being dumb
im just a bit tired
go to sleep and come back to it tomorrow
nah id like for it to be solved
im gonna try a few more things
when i ctrl clicked the "Inputs" it redirected me to the inputs script
is that good?
I... i.. i fixed it 🎉🎉🎉
private void Awake()
{
input = new Inputs();
}```
this took me like 1H
Could anyone please help me with this
Is there really no way to do the input horizontal and it automatically assign the left stick, like the old input system?
How do I get scrolling up/down?
Sounds like it may just be an issue somewhere in your action map? idk about it just automatically happening but I believe detecting input from controller is possible and shouldn't be too complicated. Maybe try explicitly defining your controller as input for your action. And then making sure it is the horizontal input from the controller?
This is very vague question, mouse scrolling can be found as an input for an action, is that what you're looking for?
Input.mouseScrollDelta
which is just
10 * Input.GetAxis("Mouse ScrollWheel");
Okee
What range does it return?
1 when scrolling up and -1 when scrolling down
I have a question about the callbacks from the actions. Is there a way to pick up the input as having happened for a single frame. Something like context.triggered?
Okay thx
If the action has no interactions, the context.started callback doesn't ever become true inside the Update method and if you introduce the hold interaction it last for more than one frame...
Im trying to keep context.performed true while button is pressed and have context.started be true for only one frame
Okay one more thing
Is there a way to get if positive/negative button of an axis is pressed? (directly button, not axis >< 0)
I dont know if this is the right place to be but for UI's using sliders and buttons with keyboard navigation and controller navigation, how can I make it so that the keyboard and controller can actually use the slider because currently it can just highlight them and doesnt do anything else, like i cant press anything to select the slider to slide it or anything and im just wondering how i can get that to be a thing
Hi, how would i convert basic GetKeyDown input to the new Input System, thanks
I just went down this rabbit hole myself
can't seem to post code. weird
click = new InputAction(binding: "<Mouse>/leftButton");
click.started += .... (mouse down)
click.canceled += ... (mouse up)
@harsh crest
and to make it actually do something you must do click.Enable()
Hi I'm having this issue where new controllers aren't recognized if I plug them in while the game is open.
If 2 controllers are plugged in when I launch the game everything is fine they both work and can be unplugged and plugged back in, but if I plug 1 controller in and start then game then plug in the next controller it will never be recognized until I restart the game.
I am trying to make it so that a bool is equal to true when a button is pressed, but once i press the button the bool true forever
I think this line of code is what is making it do performed forever
but i dont know how to get both, does anyone know how to take both performed and canceled
Hey, I'm making a local multiplayer game with controller input using the new input system. When I run the game in the editor, the player moves smoothly and everything looks fine.
However, when I build the game, the movement becomes jittery for some reason. I'm not really sure why this might be happening. I have my rigidbody set to interpolate and I believe I'm doing input and physics in the right updates. I'm using 2021.3.2f. Can anyone see what's wrong?
Here's a link to my player controller script:
https://www.toptal.com/developers/hastebin/xudelawuso.csharp
I'll also attach a video of the glitchy movement. The recording doesn't capture it too well, so it doesn't look that glitchy on video, but it's super noticeable in real life.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Hello again, just wanted to ask in regards to the New Input System, are we not allowed to use the code we make for our movement or menu stuff? 🤔
Interesting, it seems to work if the rigidbody is kinematic. It would be nice to have a dynamic rigidbody, but I guess kinematic is fine given that I don't need any forces in my game like that. Still, if people know how to make it smooth with a dynamic rigibody, I would love to hear the fix.
Huh?
Did you not also subscribe to canceled??
hello, I am having problems with my character automatically walking backwards. this problem did not exist yesterday, i closed the project, reopened today, changed nothing and all of a sudden my character is accelerating backwards. unity does not think that i am pressing S (i've checked with a debugger)
also, i stop moving backwards when the game view is not focused
Any character movement will be due to your code and you should be able to debug your way to the source of it.
Check for any plugged in controllers/joysticks too
This is embarrassing
My steering wheel was plugged in
That was the cause
Thank you
is there a way to change the order of execution of input events ?
like the UI event always fires before the player
or knowing if the UI event was fired
nvm, found a way around it
Ok this is Insane, Twice now unity has stopped talking controler inputs
and both times ive not touched anything to do with the input system
nobody know any reason why? can it get corrupted? is there an event thing needed for Axis inputs?
Did you check the console if unity detected the controller being disabled/unplugged?
console says nothing, i always have it up
... ok well it started working for bit
ive no idea why
it works in my other projects ive been using the same inputs for more than a year in diffrent games
this is not a code thing, ive made this and a clean scene to test it ```
public class InPutTester : MonoBehaviour
{
public Vector2 Stick1;
public Vector2 Stick2;
void Update()
{
Stick1.x = Input.GetAxis("Horizontal2");
Stick1.y = Input.GetAxis("Vertical2");
Stick2.x = Input.GetAxis("Horizontal");
Stick2.y = Input.GetAxis("Vertical");
}
}
there must be SOMTHING that causes it to ignore controller inputs or but all i can find when i search is people missing the basics.
Il have to waste another 2 hours rebuilding my project bit by bit again because of this bug and Worst is ive no idea why.
look, now its working but ive restarted the project like 3 times and this time it working... its like its corrupting somthing on rebuild
ok... well loading my old scene breaks the inputs for the Whole project...
yay
wth could cause that
Ok Steam doing somthing becuse it thinks its "spacewar" and when its off its all fine, they must have done something with controller inputs
Will Rewired allow me to use Pro Controller, Dualshock, and Dualsense controllers with my game?
Assuming that the only other alternative would be the old unity input system
yes
For some reason, no controllers I own work with the old input system
I was using New Input... I had issues with a trigger randomly getting stuck, couldn't figure it out.. went to OLD input, it worked fine.. went from old input to REWIRED and now i play 100% of the time with Dual Shock 5
that alone letting me test in Unity is worth 50 bucks right there
How easy is it to switch from old system to rewired
because i have a LOT of old input in my code
well i had a integration for my thing
but they give you like 200 examples
of everything
joystick to mouse. probing for input. multi input. remapping. full control remap prefab
drop in game ready
My dualsense controller and my pro controller just get garbage input
would you think that rewired would help?
yes
i can play gamepad / gamecube / PS5 / HOTAS... for god sake.. etc
the guy wrote drivers for everry gamepad and mapped it to Unity Old Input
basically
Thank you.
When I buy the package, I just install it through the package manager in my current project?
yes, but I always like to start a fresh new project
import just tat
and play with it
tinker with demos, see whats in there, read manuals, watch videos, watever
then do full Version control.. the install and go nuts
You'd say that conversion from a pre-existing old input system game would still be 100% possible? I have one interaction button, movement buttons, and look buttons
with the look buttons being Mouse X and Mouse Y input vectors
So it's not toocomplex
yah you should be fine
I am running OLD input AND was running new input and then i went to OLD input and im doing DOOZY UI with old input and all of this was same project, going back and forth and all over, and my input is still OK after all the switching
but if you want Dualshock / Nintendo / etc all working on PC, this is the way to go
Thank you so much for the reply and recommendation. I'll let you know how it goes.
ok good luck!
using the new Input System how can I detect if my mouse is over a specific button?
You can implement IPointerEnterHandler and IPointerExitHandler and define their handler methods OnPointerEnter and OnPointerExit to find out when your mouse enters and exits the button.
thanks in the end I solved by adding some event trigger directly on the buttons
However it doesn't look like there is an IPointerOverHandler or something that can replace MonoBehaviour.OnMouseOver(). So here is my question, what's the best substitution for it?
I personally just attached the Even Trigger component to every button I specifically needed that feature
I can attach a specific method they call when triggered
so you can make them call a custom "OnMouseOver" method
But I need to be able to catch "OnMouseOver" events first.
I don't see anything that fires every frame your pointer is above the button.
I think the two things shouldnt coexist, your either use the IPointer interfaces or you set everything via editor by assigning Trigger Events
I can't do it either way since there is no event to begin with.
you just use IPointerEnter/PointerExit to set a bool and Update
It doesn't work if the button is moving and the pointer is not.
The button is moving?
Yeah
well that's a bit of an edge case
Resolved with some magic. Thanks for the answers.
I am trying to use new input system for local multiplayer, but both players are moved by the same input, its driving me crazy. Does anyone know a fix?
The new input system is kinda hard. I literally can't find the 2d vector binding can some one help?
Hey i have this errror and dont know how to fix it
Can you show your Build Settings?
So, the problem is, indexing starts with 0, so the scene with build index 2 can't be loaded because it refers to the scene number 3, and you only have 2 scenes.
ammm so i need to just put +0 in the code?
or just change the index to the scene name?
You can load scenes by name like so: SceneManager.LoadScene("Scenes/SampleScene")
Thanks it worked, and should i worry about the 2 audio listeners message?
Yeah, you probably have 2 cameras and each of them has its own audio listener component. Remove one of them.
(one of the listeners, not one of the cameras)
thanks the errors are solved now, but i have another problem when i click on the start buton nothing happens it just shows a black screen. I can see that the scene has changed but the scene does not load for me 😦
Can you show your input asset and code for player movement? I suspect, both players are subscribed to the same events.
Does it print anything in the console?
sadly no
Try substituting "Scenes/SampleScene" with "SampleScene".
sadly did not work
If you open the SampleScene itself by double-clicking its asset, does it work fine?
it opens up left side, but the view doesn not change in the editor
And when you hit Play?
it just stays in the start screen
Can you screenhot the entire unity window after opening SampleScene this way?
this is after i play the game and press "Žaisti'
This is before
What about the black screen?
sorry that was before, it doent happen anymore, now it just stays in the same scene image
You have both scenes opened at the same time. MenuScene is literally a black screen since it only contains a camera, while your menu belongs to SampleScene. This can be seen in the hierarchy.
So close the SampleScene and move your canvas to the MenuScene.
all of my canvas? it cointains thing i need to see in the samplescene
Actions > + > Add 2D vector action or something.
It's better to have a separate canvas for each scene. When you load a scene, the one you had before gets replaced completely. There is a way to bypass this with DontDestroyOnLoad, but this is definitely not the right case for that.
ye so i moved the main menu stuff into the menuscene and now after i start the game it does not show at all
Screenshot
and if i start the game it just goes instantly to the sample scene
You still have both scenes opened at the same time.
SampleScene is the 1st in the hierarchy, so that's what you see.
ohhhhhh i needed an eventSystem
Not if the button worked without it.
i added a canvas and it seems to be fixed but the resoliution of the main menu image is messed up when i build the game i see it at a small window and everything around it is generic unity blue color, what can i change?
and the main camera sees this now
The camera doesn't see anything, blur is set as the background color for it.
Compare your canvas object with this:
it helped but still i dont get the full screen p.s. i changed the backroudn color to brown
Screenshot this for your canvas.
Seems fine. And this for your camera:
i only see these settings
Ah, that's because of different render pipelines.
Can you screenshot the Scene window again while camera is selected?
Like so
like this?
Yeah, what happens when you try to resize the canvas from here?
nothing it does not let me do that
That's good, now just resize the camera so the canvas fits in perfectly.
amm how can i do that?
White circles on the borders
@blissful bridge
sorry if its messy this is my first time sharing code like this
i restared unity and now this is what i see, cant move anything
Is it a good idea to write a state machine for handling contextual left clicks or should I be doing something different?
what left click does differs in almost every situation and even differs depending on what the previous click was so that sounds like a state machine to me but I'm not very experienced with mouse input
Just create actions for each situation and assign a left click binding to each one. (It shouldn't actually matter if their defaults are all set to left click or something completely different: players should be able to rebind them freely.) Ask player input component to send c#/unity events and subscribe to them where appropriate. That's it. Just don't forget to validate the input, e.g. check what the previous click was where you need it.
Hello I have a joystick for movement and a code for my mouslook where I move my screen when I touch.
The problem is when I move the joystick it interferes with the touchscreen
Please someone help I have been stuck on this for days
What input system are you using?
Let's learn how to implement touch controls in Unity!
● Project Files: https://github.com/Chaker-Gamra/FPS-Game-Unity
● Joystick Pack: https://bit.ly/3xytjhl
● Standard Assets: https://bit.ly/2SL1pji
● FPS Controller: https://youtu.be/3XUC2C2SpTs
● Build Game To Android: https://youtu.be/Vp6cxY9yv30?t=289
● NEW INPUT SYSTEM: https://youtu.be/m...
both
in the settigns i selected both
this is tutorail i used
this one
it worked until like 12: 25 where i got the same issue with him
i followed what he did but nothing changed
So when you move the joystick, it also rotates the camera?
yh
In the video they check if pointer is over game object, with the object being this virtual stick. If it is, they don't move the camera.
Hey folks,
Using the new input system with C# events.
My player should be able to jump, or move along the x axis.
As such on move started I set a float with the input value, and on canceled I set it to zero.
Then in FixedUpdated I have this
if (_horizontalMovement != 0)
{
_playerRigidbody.AddForce(
new Vector3(_horizontalMovement * sidewaysForce * Time.deltaTime, 0, 0),
ForceMode.Force
);
}
It's working great and I understand that multiplying by Time.deltaTime is to fix framerate specific issues.
For the Jump I have .performed bound to a single method which currently does
private void Jump(InputAction.CallbackContext ctx)
{
_playerRigidbody.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
}
My question is - do I need to use Time.deltaTime here too?
If not, then why not?
For FixedUpdate, you will want to use Time.fixedDeltaTime instead of Time.deltaTime.
For impulse type force, I believe there is no need to multiply by delta time.
Acceleration Add a continuous acceleration to the rigidbody, ignoring its mass.
Impulse Add an instant force impulse to the rigidbody, using its mass.
VelocityChange Add an instant velocity change to the rigidbody, ignoring its mass.```
Keywords are instant and continuous.
When calling AddForce you never need deltaTime or fixedDeltaTime
As long as you are calling AddForce in FixedUpdate, which you always should
If you do ForceMode.Impulse and multiply by fixedDeltaTime that's the equivalent of doing ForceMode.Force
Thank you
Yh I copies his code exactly
I have been trying to add local coop to my game with new input. But both chracters are controlled by all controllers, I figured a way to get indpendant movement but unity events dont trigger the same as update and its a really poor experience. doe anyone know a way to get seperate actions in local coop
@austere grotto ive tried the things that are suggested here, I think the issue is because of input asset not being duplicated? But i dont know how to do that
PlayerInputManager does it for you
do you know of any common reasons why more than one character would be controlled by one
@austere grotto
because you set everything up wrong
you need to use the PlayerInput component
and you need to use PlayerInputManager to spawn the player prefabs
If you're not doing that, you'll have issues.
And how's your code set up
i think this has something to do with it?
Yeah this is all wrong. You're using the generated C# class file from your input actions asset instead of the real PlayerInput component
Read up on how the PlayerInput component works. It's in that same link I sent above
ok
Ey is there a way to make it that if I put my finger on a joystick I would have to use a second finger for my screen
Idk man I'm lost just like u
Does anyone have like a standard input system i can freely use that basically just registers a touch on an ios or android device as a click?
is there amny way to change the min/max values
so instead of a dualshock 4 trigger being at rest and giving value of -1 it gives 0?
Can We Do Key Rebinding using unity old Input System
Sure, make a subscription system and associate particular keys with functionality.
Is their any tutorial about it...
Doubt it but you could always ask Google.
Can you explain it a little more pls
Let's say you want your player to jump when one of those keys is preseed: Space, W, ↑. Create a list and put all those keys in there. You can later edit the list to rebind some keys. Make an event that gets invoked every time you press one of those keys.
{
if (actions["Jump"].Any(binding => Input.GetKeyDown(binding))) Jumped();
}
public event Action Jumped;```
Subscribe to this event where you want to handle it.
```private void Start()
{
YourInputClass.Jumped += HandleJump;
}```
Hello there, I am having an issue with my third person controller, the camera's sensitivity became quite high after importing another vehicle controller. I tried deleting some of the new input cs files but the issue persists
You probably have framerate dependent code
You are probably making some calculations in the Update() funcion of some of your scripts, but are not considerating the Time.deltaTime value. So the sligthtly changes on your fps could mess up your more sensitives behaviours
Seems so, thank you all for the help
Hi, I dont understand how to make make toggle interaction in new input system. I want to be able to press button and action 1 start, and press button again and action 1 stop
bool actionisStarted;
void HandleInput() {
actionIsStarted = !actionIsStarted;
}```
not really an input system problem
more of a code problem
Using the new InputSys I'm trying to simply move the mouse cursor using the controller
leftAnalogMovement = controls.Player.LeftAnalog.ReadValue<Vector2>();
if(leftAnalogMovement != Vector2.zero)
{
Mouse.current.WarpCursorPosition(Mouse.current.position.ReadValue() + leftAnalogMovement);
}
This is the code, It works but the cursor only goes up and left .-.
Rather than warping the system cursor just use a virtual cursor
Like an object in the scene that gets moved by both mouse and controller?
a UI element, yes
Problem is I'm using lots of Event triggers so would be pretty easy to just move the cursor with the analog
Is it problematic?
The new input system has support for this kind of thing built in actually https://docs.unity3d.com/Packages/com.unity.inputsystem@1.1/api/UnityEngine.InputSystem.UI.VirtualMouseInput.html
Do I have to manually generate it via code?
nvm found the component
I'm trying it out, the virtual one doesnt seems triggering the Event triggers
the Hardware more does it but its literally the same as using cursor warp
Hello I'm currently issues with the input system trying to get input from a gamecube controller adapter and was wondering if I could get some help with it
The game I'm currently working on is a platform fighter (Think smash bros), so gamecube controller support in one way or another is a must
Currently when I go into the new input system debugger I can see my adapter but none of the inputs appear
The adapter is a 4 port mayflash gamecube adapter
No events register when a button is pressed with a controller plugged into any port
Anyone got any ideas why nothing is registering?
Seems to be a pretty rare problem since not a lot of people are designing their games for a 20 year old controller and old hardware, and all of the stuff I could find on it was the old input system
i made some inputactions and id like to reference them and see if they were used , but using public InputAction i can not select them but instead the inspector wants a path? AM iusing the wrong type?
i did it different now, using a reference to the Player Input component and then getting the InputAction via code, is that how youre uspposed to do it?
it's one of the ways to do it
also do I have to enable inputmap/ inputactions in code ? is there no way to have them all enabled by default?
I do command in my game to move the player it is:
if (Input.GetKey(KeyCode.W)) { Transform.position = transform.forward * speed * Time.deltaTime; }
And for the jump:
if (Input.GetKeyDown(KEYCODE.Space)) { Getcomponenet<rightbode>(), velocity(0, 25, 0) }
And it's working with me but I can jump 2787282 per second and is can move in the sky
🤣
How i can do it?
The project 3d
And i put varibal for speed
But I can move in space and sky 
Assalamu alaikum
I'm guessing that you can infinitely press the space bar
You have to check if you are on the ground
void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.tag == "Ground") {
onFloor = true;
}
}
So you would need to replace the 2d with 3d if u are using 3d and basically u need to go to your ground platform and set a tag to it and call it Ground
Then replace if(input.Getkey(Keycode.W)) with if(input.Getkey(Keycode.W &&
onFloor = true))
Let me know if it works
Ok thx you my friend 
Why the collision is 2d
The project is 3d
Oh nothing thx you
Yh u can try replacing it with 3d
void OnCollisionEnter(Collision collision)
{
}
U can use this instead
Np salams lemme know if it works

ok idk if im dumb as rocks but ive been looking all day yesterday for a way to access the invert box in the input manager through code in visual studio to invert camera controls, is there a way to get that setting?
Input Manager is completely not accessible through code
Which is why the old input system is not great
inverting it should be as simple as multiplying the value by -1 though, so easy enough to do in your own code.
oh, alright thanks for letting me know, i'm using the cinemachine camera so i thought the easiest way to invert the controls would be to mess with the input system, ill keep looking for other ways.
Uh so i downloaded the new IS but the namespace isn't showing up
any ideas?
proof that it's installed
proof the namespace aint present
nvm clicked on regenerate project files and it fixed
while I was testing my game, I came across these errors but they never appeared before. I didn't add any input code before this error showed up so what should I do?
it doesn't really affect my game but how should I fix it
You need to convert your input module. There's a button on it to do so.
It's a component on the event system GameObject
hello everyone, I've been stuck with this for sometime now, my input code works on device simulator but doesn't work on my android mobile phone, this is the code;
// Track a single touch as a direction control.
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
Diference = (Camera.main.ScreenToWorldPoint(touch.position)) - Camera.main.transform.position;
if (Drag == false)
{
Drag = true;
Origin = Camera.main.ScreenToWorldPoint(touch.position);
}
// Handle finger movements based on TouchPhase
switch (touch.phase)
{
//When a touch has first been detected, change the message and record the starting position
case TouchPhase.Began:
// Record initial touch position.
Debug.Log("Began");
startPos = touch.position;
break;
//Determine if the touch is a moving touch
case TouchPhase.Moved:
// Determine direction by comparing the current touch position with the initial one
Debug.Log("Moved");
direction = touch.position - startPos;
break;
case TouchPhase.Ended:
// Report that the touch has ended when it ends
Debug.Log("Ended");
break;
}
}
To implement camera movement, zoom and rotation for city building games.
The input actions are different for mouse, keyboard and touches.
For example to implement camera zoom with touches, we require three input actions (two touch positions corresponding to two fingers and a touch contact button) but if we go with mouse, it is required only scroll value.
How do you handle? Separate action maps for each?
I do not think I can use one input action with several bindings for each input type (mouse, keyboard and touch)
why am i getting this error?
Sometimes one input action with different binding does not work for different inputs (touch and mouse). So, how do you handle it? The detection routine is different and I cannot put them in one input action.
Separate input control or action map?
Game Input control -> Camera (Action Map) -> Zoom (Input Action)
Game Input control -> Camera_Touch (Action Map) -> Zoom (Input Action)
Game Input control -> Camera_Mouse (Action Map) -> Zoom (Input Action)
Camera Input control (Touch) -> Camera (Action Map) -> Zoom (Input Action)
Camera Input control (Mouse)-> Camera (Action Map) -> Zoom (Input Action)
Check if it is null or not, player_input and weapon_input.
Player_input should be created
its fixed now, and no that was not the problem , i still don't know how its fixed but i mean if it works then it works ¯_(ツ)_/¯
The line shows exactly where the problem is. Maybe it is inside performed callback, Camera.main ,..
Please help.
I am using the new input system and was making a for loop and well...
My for loops are broken?
To implement camera movement, zoom and rotation for city building games.
The input actions are different for mouse, keyboard and touches.
For example to implement camera zoom with touches, we require three input actions (two touch positions corresponding to two fingers and a touch contact button) but if we go with mouse, it is required only scroll value.
How do you handle? Separate action maps for each?
I do not think I can use one input action with several bindings for each input type (mouse, keyboard and touch)
@winter basin
Hey thanks for the response, I’m not really using the new input system for this, so I think the code there is pretty much it on how I handle the inputs.
And I’m trying to just drag left and right on the x Axis only. It works on the device simulator
There's nothing wrong with this specifically, your problem lies in the rest of your code, or where you put this code.
Also this is a #💻┃code-beginner question not input system related.
I've been having an issue with the axis for an Xbox One controller. I found the axis for the left and right stick, but there seems to be just 1 singular axis for both triggers (left trigger adds negative value, right trigger positive). I've been trying to make it work as a button and while I could make that, I'm unable to figure out how to check if both triggers are pressed, since axis value of 0 could mean they are both pressed fully or not pressed at all. Does anyone know if it is possible to separate the triggers to 2 individual axis, or if there is something else that I could use in this case instead of GetAxis?
Make an Action of type Button. Create a Binding with whatever button you want.
Hey guys. I'm implementing controller support using the new input system and testing in Editor is fine but when I build for android, none of the controls work. I'm using the SteelSeries Stratus Duo controller. In the logs I can see that the controller is connecting properly via bluetooth but it's using the old input system? I have active input module in Player settings set to "Both"
Any idea where are these logs coming from?
any idea why this automatically goes to a value of 1 and only goes between -1 and 1, no in between
Hello everyone
I tested my mobile touch input on the unity device simulator and it worked fine, but when I try it on an actual mobile device it wouldn’t work, what could be the issue please?
Do u have any invisible panels around the joystick?
hey gang, has anyone ever encountered an issue where enabling the action map and adding delegate subscribers at the same time in OnEnable() causes neither of them to work?
they both work when theyre the only pieces of code in the function, but when theyre in there together they throw a fit
maybe you need to be a bit more precise about what exactly you are doing and expecting to happen (how do you check if they work or don't, any errors, any other things affecting the action maps?)
you could always use Input.GetMouseButtonDown(0) for left click or respectively Input.GetMouseButtonDown(1) for right click
does this look like the old input system to you? seriously?
im using the new inputsystem package
L
i was just trying to help but ok
What is the difference between the old input system and the new input system
Pinned message, first link.
Clicking with my left mouse button does not seem to trigger the corresponding ".started" event in my game, any idea what might be amiss?
and if i switch to ".performed" it triggers twice, once when pressed and once when released
You'd have to show:
- how the input action is configured
- how the binding is configured
- how your code is set up
in the relevant script's Start() method, we have:
controls.Default.Interact.started += ctx => OnClick();
and OnClick right now just prints a message to the console.
I don't think passthroughs ever give you started or canceled
I think you can just make it Action Type -> Button
so this is the only script that touches the input system atm, and im just trying to enable the input controls in OnEnable() like this
private void OnEnable()
{
PlayerControllerEvents.HandlerSetupEvent += HandlerSetup;
controls.Enable()
}
however, controls.Enable() breaks everything if its in OnEnable() with the delegate assignment. Putting either the controls.Enable or HandlerSetup assignment in individually will work, but means the other one never gets called.
debug inputs show that it detects input when controls.Enable() is in OnEnable or that HandlerSetup is running when the delegate assignment is in there, but neither call when theyre combined
you are still only showing things where you already know that they aren't containing the error
Hello everyone, I have a problem with a script, on a normal 3D scene everything is fine but when switching to HDPR I have Assets\Scripts\FirstPersonController.cs(67,11): error CS0246: The type or namespace name 'PlayerInput' could not be found (are you missing a using directive or an assembly reference?)
That has nothing to do with render pipelines
You're missing the input system package, or you forgot a using directive
while playtesting my game, unity still responds to all my keypresses so game window gets resized when i try to sprint and jump at the same time
Have u installed the Input system library?
How do I switch the old input system code for the new one?
The Unity learn tutorial says to make sure Api Compatibility Level is .NET 4.x , but there is no option for it. I'm in 2022.1
Yes
Then you're simply missing a using directive, as the error says.
What works like the Input.GetButton in the new Input system
I tried that and it always debugs default
It kinda depends on a bunch of things too:
- Whether you properly enabled your
inputActionsobject - how you configured the
Jumpaction - When you are running this code
Noo
Now it works lmao
thx
One more thing
Can I get if a positive/negative button of an axis is pressed? (not checking the axis value, cuz then holding both would return the same what holding none)
Hi there, so I'm newbie at unity and i was wondering if I should use tutorials with the new input system, or the older one? Because, it seems like there are more tutorials available out there using the old default input system
If its a big project use new input system. If its a small one use old input system.
I would recommend new input system, more feature packed, there are tuts on both
I have space as a jump key, and w as an alternate. How can I stop them both from registering and applying a double velocity jump, if pressed simultaneously?
Hello
So i'm trying to use OnEnable to register events using the Input System
But it always gives me a NullReferenceException
But if I register on Start() it works
Thankss
I've never seen this before
how do you make an action show up in the events list on the player input component
Hey friends!
I subscribed a method to the action.performed event, but the method is only called when I press the key for the first time (I have a flag that checks if the game started before allowing the player to move, but even if the flag is set to true, the player will only move if I press the key again). Is there a way to make the method work so the player moves as soon as the flag is set to true?
This would be my method that's subscribed to the .performed and .canceled events
I'd like to have the player click on the screen to make things happen, like commanding units to move to a point. I have a GameObject with a PlayerInput > Events > UI > Click > Runtime Only / MonoScript.name / MyScript / Hello. in MyScript i have a public void Click(InputAction.CallbackContext context) that is not being triggered. What did I miss?
the docs (https://docs.unity3d.com/Packages/com.unity.inputsystem@1.3/manual/Components.html#notification-behaviors) refer to a NewBehaviourScript.SendMessage option that is not available to me.
@paper tusk I don't understand your description of the problem. I got lost at
the player will only move if I press the key again
Okay so I am struggling here... Player Input > Events > Player Movement > Thrust CallbackContext --- within the Thrust CallbackContext event, I have it set to Runtime only, my script is slotted and when I go to select my function, there is no options...
Here is my function I am attempting to call there:
public void OnThrust(InputAction.CallbackContext context)
{
thrust1D = context.ReadValue<float>();
}
What am I doing wrong so that I cannot select the function I want the event to trigger?
I have called using UnityEngine.InputSystem; before any functions.
Any help would be awesome!
]
I have the same right now. No Function or Monoscript.name.
I put my method name but i don't get a callback.
is there an equivalent in the new input system to input.AnyKeyDown?
I want to make a "press any button to continue" screen
oh man it was in the quick start guide? how did I miss that? Rip. Thanks for your help!
they recommend don't do it much, it's expensive.
yeah, I only intend to use it for 10 seconds in one place so it shouldn't hurt that badly. Appreciate the advice though!
@weary nimbus I might have it working. I added a PlayerInput to GameController. I created a GameObject that has a my Script. The Script is ```cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class EditBP : MonoBehaviour {
public void Click(InputAction.CallbackContext context) {
Debug.Log("EditBP.Click");
}
}```
then in GameController > Player Input > Events > UI > Click I set Runtime Only and chose Scene > the GameObject with my Script. the dropdown that appears automatically offered me EditBP.Click.
Got it! I will try that when I am home. Appreciate it! @brave gyro
I guess I've got my actions set up wrong because I click all over the screen and I don't get the log report.