#🖱️┃input-system

1 messages · Page 2 of 1

sullen lintel
#

I did

sudden lagoon
#

Any one could help?
I am trying to check if touch event was triggered on UI or not. But cannot find correct way. IsPonterOverGameObject is late one frame, so I cannot check if I actually selected UI or not. I am starting pulling my hairs out...

EventSystem.current.IsPointerOverGameObject());
viral whale
#

Hello, i have a problem that keeps happening to me, when using OnTriggerStay, it does not register my input if my player stands still, I have to move around inside the collider and press a input multiple times for it to activate!?..

austere grotto
austere grotto
#

Other functions do not run every frame

heady river
sullen lintel
heady river
#

ahh so i debugged and its not registering my key pressed so its not switching the animations

heady river
#

Null?

sullen lintel
sullen lintel
heady river
heady river
sullen lintel
lusty haven
#

can anyone help to know each type for those like axis is float

chilly verge
#

Did the new input system recently make it so you can't have multiple actions checking for the same input? I have two action maps, the first action map is for base player movement which is testing for the WASD keys, the second action map is for a minigame that appears on the screen and it tests for A/D input, when I was using unity 2021.3.3f1 I could have both action maps running at the same time with no issues, but I recently upgraded my project to 2021.3.8f1 and ever since then A/D input is only detected when I disable the other action map, is this a bug or a new feature recently added? Cuz it's messing up a lot of things in my game now and its been hella annoying to work around

heady river
heady river
#

wait i didnt even send the ss

#

@sullen lintel

sullen lintel
heady river
heady river
tired juniper
#

How would I go about detecting when a flick occurs on the joystick and then calling a function based on that flick? I can't seem to figure out how to do this with the new Unity Input system so do I have to use the old system?

#

Basically, I want to create a binding for when the player flicks from one extreme of the joystick to the center

austere grotto
#

You'd probably need to write a custom interaction for that to be done in the binding itself

tired juniper
austere grotto
#

yes

#

that's why I suggested it might

exotic spear
#

Hi I've noticed a problem with my mouse look in my game in which it periodically jerks to one side at seemingly random times as shown by the highlighted bit in console logs below
I'll also include my settings and code snippets

    {
        look = value.ReadValue<Vector2>();
        Debug.Log(look);
    }
#

I use dynamic update for the input system in project settings

sullen lintel
exotic spear
austere grotto
#

I think you just have a slow frame which is leading to a large single-frame mouse delta

exotic spear
#

It happens fairly often and corresponds to my mouse look over rotating/snapping each time it happens

#

is it possible that it's happening because I'm multiplying the rotation by Time.deltaTime

austere grotto
#

you should definitely not be multiplying mouse input by deltaTime

exotic spear
#

ok

#

Any advice on how to make it smoother then because it is very jittery otherwise and my inputsystem is set to Dynamic Update

exotic spear
austere grotto
#

there should be nothing to smooth

#

mouse input is framerate independent automatically

#

One mistake may be:
look = value.ReadValue<Vector2>(); if you're doing this you may be consuming the same mouse input multiple times

heady river
#

Unless maybe my ide wasn’t configured when I put in the debug.log so that’s why I didn’t see it I’ll try it tomorrow

exotic spear
sullen lintel
shy spade
#

my g29 pedals are interfering with the Vertical Axis from the Unity Input System, can i somehow make my pedals to not be recognized as controllers?

heady river
#

should i put the code in my player controller script

sullen lintel
sudden lagoon
austere grotto
#

which raycast?

#

Physics raycasts are unrelated to the UI system

#

I do think UI toolkit has its own event system? Not sure about that

mild vortex
#

Input.GetButtonDown("Fire1") equivalent? I specifically don't want to access this input via an event, but rather access it when needed.

austere grotto
#

you don't have to do things via events

#
myInputAction.WasPressedThisFrame()```
mild vortex
#

InputActionsName.ActionMapName.Action.WasPressedThisFrame(); then?

austere grotto
#

however you want to get a reference to your InputAction is fine

austere grotto
mild vortex
#

Cool, thanks!

sudden lagoon
austere grotto
#

(look at the component above)

sudden lagoon
#

Yes, but InputSytem convers it with input system UI input module, doesnt it?

austere grotto
#

there's always an input module

#

the input module is how the input system interacts with the event system

#

every combination of input system + ui system has a combo of event system + input module

sudden lagoon
#

so in the end I was doing what you were suggesting. But in a way that does not work 😦
So in short:
frame 1: TOUCH event happen -> Event of it is called -> My function is called -> Check if over UI fails.
frame 2: TOUCH event happen -> Event of it is called -> My function is called -> Check if over UI suceeds.

sullen lintel
brave dawn
#

for openXR how hard is it to allow the VR player to use keyboard + mouse?

#

I want the vr player to use a computer in vr

brave dawn
#

mb

west oracle
brave dawn
#

Hp reverb with controller

primal salmon
#

I have a UI and Player ActionMaps. the inputmodule has the actions assigned from the UI section however when i disable it in code like

controlScheme.UI.Disable();

the UI still works

#

how can i disable it from working

austere grotto
olive mortar
#

Whats wrong here? O.o

austere grotto
olive mortar
#

1.0.2

#

unity 2020 LTS

austere grotto
#

that' why

#

There's no WasPressedThisFrame in 1.0.2

#

you should be able to do if (context.started) though

#

or if (context.phase == InputActionPhase.Started)

olive mortar
#

wont that trigger the event ever time the key is held down, rather than a single frame event?

austere grotto
#

no

olive mortar
#

ah ok, thank you 🙂

primal salmon
naive geode
#

For some reason Run reacts only to A presses (I'm on a non standart layout) even though I press Q and the rest of unity detects the letter q fine

spark pumice
naive geode
#

okay yeah

olive mortar
heady river
#

sorry caps lock

#

it works

heady river
#

Sort of instead of transitioning it’s just turning the animation on and off so it’s half working

olive mortar
#
    public void OnLook(InputAction.CallbackContext context)
    {
        Vector2 lookAxis = context.ReadValue<Vector2>();

        bool invertedKB = !UsingGamePad && SettingsMenu.Instance.InvertY;

        cameraInputData.InputVectorX = lookAxis.x;
        cameraInputData.InputVectorY = invertedKB ? -lookAxis.y : lookAxis.y;

    }```
austere grotto
olive mortar
#
    void CalculateRotation()
    {
        if (Player.Instance.updatePlayer && Player.Instance.IsAlive())
        {
            float baseSensitivity = Player.Instance.GetInputHandler().UsingGamePad ? sensitivity * controllerSensitivityMultiplier * Time.fixedDeltaTime : sensitivity;

            m_desiredYaw += camInputData.InputVector.x * lookSpeed;
            m_desiredPitch -= camInputData.InputVector.y * lookSpeed;

            m_desiredPitch = Mathf.Clamp(m_desiredPitch, lookAngleMinMax.x, lookAngleMinMax.y);
        }
    }

    void SmoothRotation()
    {
        m_yaw = Mathf.LerpAngle(m_yaw, m_desiredYaw, smoothAmount.x * Time.fixedDeltaTime);
        m_pitch = Mathf.LerpAngle(m_pitch, m_desiredPitch, smoothAmount.y * Time.fixedDeltaTime);
    }

    void ApplyRotation()
    {
        transform.root.eulerAngles = new Vector3(0f, m_yaw, 0f);
        m_pitchTranform.localEulerAngles = new Vector3(m_pitch, 0f, 0f);
    }```
austere grotto
#

where and when does this run

olive mortar
#

Update

#

lateupdate*

#

used to run fine when using rewired

limber gull
#

hey guys
i need to use the newer input system but i cant seem to find where it contains the mouse movement
can only find mouse buttons

#

actually might have just found

olive mortar
#

remove the text, and navigate to Mouse -> Delta

limber gull
#

yeah i found it actually

#

now i just need to go back to an older project to remember how to rotate the camera good

limber gull
spark pumice
olive mortar
#

Input.GetAxis etc

spark pumice
olive mortar
#

it worked perfectly fine though when i was using Rewired though

#

which is essentially just a wrapper for input manager

spark pumice
olive mortar
#

I can test this out now, if you have time for me to get the findings?

spark pumice
#

like, smooth damp will add acceleration both on the stop and start side of things

#

but you might only want it on the start side

#

and stop immediately

olive mortar
#

its not just the abrupt stopping, it sometimes wigs out and slightly goes in the completely wrong direction

#

it's a little hqrd to discern from the video

spark pumice
#

yeah, its hard to know what the inputs were from watching the video. You get more of a feeling for it when you're actually controlling it

olive mortar
#

Revelation. maybe

spark pumice
#

there's a little wiggle at 0:05, is that it? or did you actually do a wiggle with the control

olive mortar
#

its entirely smooth with Mouse X and mouse Y with input manager

#

but when im pressing WASD, my lookaxis debug is firing off

#

i'm telling you. if this is the goddamn problem

#

i looked at this atleast 12 times

#

ok no that definitely isnt it, its still wrong

#

let me get a better video for you

#

but yes: using input.getaxis, its flawless. so definantly something to do with input system, and actually registering input with it

spark pumice
#

Does GetAxisRaw give you the same behavior as the input system?

olive mortar
#

lets test

#

GetAxisRaw is also perfect

#

(i am moving my mouse smoothly)

spark pumice
#

oh yeah, that's way nicer

#

but also a lot slower

#

HMMM

olive mortar
#

do you want a comparison video with axisraw

spark pumice
#

no, if it wasn't having obviously the same issue as input system then it's not really relevant

olive mortar
#

this is the Look setting in the input action

#

mouse specific

#

I have also tried Control Type -> Vector2 same result

austere grotto
olive mortar
#

the same thing

#

wrote it in the initial question

austere grotto
#

can you show all the settings you have for the input action and the bindings

olive mortar
austere grotto
#

that will definitely cause issues

olive mortar
#

trying to fix it, but shouldnt it be normalized anyway? 0-1

austere grotto
#

no

#

mouse input is like a number of screen pixels the mouse moved

olive mortar
#

thats all there is

austere grotto
#

try this:

  • remove the game pad binding
#
  • remove the normalize processor
#

see what happens

#

and set it to Value/Vector2

olive mortar
#

Same result

#

just mega fast mouse movement now

austere grotto
#

adjust your sensitivity down

spark pumice
#

are you supposed to multiply a mouse delta by deltaTime? Probably not, right?

olive mortar
#

its alot smoother now. its not skipping all the time

#

it has skips every so often, and feels abit

#

GetAxisRaw * 100

#

it'd be easier if i could screenshare this rather than videos all the time hehe

austere grotto
#

I mean one thing to do is just like:

void Update() {
  Vector2 newInput = lookAction.ReadValue<Vector2>();
  Vector2 oldInput = new Vector2(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"));
  print($"Input comparison - old: {oldInput.ToString("F4")} new: {newInput.ToString("F4")}");
}```
#

and play with the settings till you see them working the same

#

obviously make sure you have both inbput systems activated for this test

olive mortar
#

So you're saying not use an event?

austere grotto
#

Yeah I don't think using events is a good idea for "continuous" input in general

#

like input you expect to change value every frame

#

events are best for things like buttons

#

or taps, or swipe interactions, etc.

#

you can definitely make it work

#

but it's harder

olive mortar
#

I feel like i should be normalizing it

spark pumice
olive mortar
#

this is also true, it needs some refactoring for sure

#

but i don't want to refactor something thats currently broken 😛

spark pumice
#

I'm just wondering if that's the bug

olive mortar
#

its not, since input manager works

spark pumice
#

oh fair

olive mortar
#

so its defiantly not right. this is with normalized @austere grotto

spark pumice
#

seems like you want to clamp it, not normalize

austere grotto
#

normalize is definitely wrong for mouse input

olive mortar
#

but GetAxis is normalized?

austere grotto
#

no

#

not for mouse input

#

I mean you can see right there it's not

olive mortar
#

true

austere grotto
#

That vector has a magnitude greater than one

spark pumice
# olive mortar

in this image, old is 20x new. seems like they jsut have different sensitivities

olive mortar
#

so i should not normalize, and clamp instead

#

-1 to 1

spark pumice
#

or divide by 20

austere grotto
#

I think one thing to look at is the sensitivity in the old input manager axis

#

Mine seems to be at .1 by default (or maybe I changed it in my project?)

olive mortar
#

yea 0.1 for me too

#

i'll try a scale modifier and set to 0.1?

austere grotto
#

perhaps

austere grotto
# olive mortar

I think the .1 accounts for the 10x here, but not the other 2x

#

That's a little bit of a puzzle 🤔

olive mortar
#

ok, i can see now its double, right?

austere grotto
#

yep looks that way

olive mortar
#

so 0.05 scale should do it

spark pumice
#

the most magic of numbers

austere grotto
#

yeah aka 1/20 which matches Tachyon's observation earlier

#

I feel like there's probably some other setting accounting for the remaining 2x scale but I'm not sure what it is

olive mortar
#

with this information, i might know what was doing the problems

#

because it was obviously mad scale

#

any slight twitch was picked up in the movement

#

right?

austere grotto
#

seems reasonable

spark pumice
#

and maybe some noisiness left in the control, even after Unity's smoothed it

olive mortar
#

it still skips sometimes

#

like, has a big jump, but it is smoother

austere grotto
#

ok well - we've at least made the picture somewhat clearer I hope

olive mortar
#

Half the battle, though we've deduced that it was the scale for the majority of it. though theres no connection to this jumping

austere grotto
olive mortar
#

negative

austere grotto
#

you might deduce this with the profiler or by printing deltaTime along with the input data

austere grotto
#

does it differ at all from the Input.GetAxis data (after your scaling) when there's a jump?

olive mortar
#

i'll get the jumping again and take a look. its hard to find the debugs since its every frame :P;

austere grotto
olive mortar
#

it doesnt print when theres a jump, so they are the same

austere grotto
#

so - could it be hardware related?

olive mortar
#

in what sense

#

its not my mouse, as old way is fine

austere grotto
#

Well I'm not sure - basically we've ruled out that the input system is giving different data

olive mortar
#

something here, must just be broken, i dont know

austere grotto
#

so it could just be your code

#

or hardware

austere grotto
olive mortar
#

its for controller

#

which we've removed the bind for now anyway so its not used

austere grotto
#

What about the SmoothRotation function?>

#

Not seeing where that's called

#

is it still used for mouse?

olive mortar
#

yes

#

all 3 of those functions are called in LateUpdate

austere grotto
#

can you try disabling that and/or using deltaTime

#

seems odd to use fixedDeltaTime in a non-Fixed update

olive mortar
#

yea, one sec

#

Same thing occurs

austere grotto
#

what change did you make?

#

switched to deltaTime, or removed the SmoothRotation call?

olive mortar
#

switched to time.deltatime. im now going to test without smooth rotation

#

I don't think its doing it without the smoothing

#

little hard to tell, but i dont get big jumps, thats for sure

#

could it be some sort of gimble lock?

spark pumice
#

is it jumping in both yaw and pitch? or just yaw?

olive mortar
#

im not sure i can answer that, its always in like a diagonal

#

let me double chekc

#

its in both, up down left right diagonals

#

this is all abit strange from just changing how some float gets a value haha

#
    public static Vector3 SmoothDampAngle(Vector3 from, Vector3 to, ref Vector3 velocity, float smoothTime)
    {
        return new Vector3(
          Mathf.SmoothDampAngle(from.x, to.x, ref velocity.x, smoothTime),
          Mathf.SmoothDampAngle(from.y, to.y, ref velocity.y, smoothTime),
          Mathf.SmoothDampAngle(from.z, to.z, ref velocity.z, smoothTime)
        );
    }``` i do have this. if this would be better to use?
#

or just the Mathf one i guess, idk what is actually causing this problem though

spark pumice
#

it would probably cover the bug up

olive mortar
#

oh we dont do that here

spark pumice
#

which is good enough, I guess

olive mortar
#

i did not know i could do this

#

(sorry)

spark pumice
#

lol no worries

#

the sensitivity thing wouldn't have been fixed by this

olive mortar
#

sensitivity thing?

#

oh, the scaling yea

spark pumice
#

the previous issue? with 20x values

olive mortar
#

would i put the same thing into the smoothTime as with the lerp angle?

spark pumice
#

I wouldn't pass something multiplied by deltaTime into that. Just your smoothAmount parameter

olive mortar
#

i dont think its a 0-1 scaled value, is that a problem

spark pumice
#

smoothTime is like... how many seconds should it take to go from A to B.

#

roughly

#

so no, doesn't need to be 0-1

#

but you'll need to tune it to whatever sensitivity you want

olive mortar
#

gotcha

#

lets test it out

#

any value for smoothtime that makes it actually move in a respectable amount of time, has this jumping

spark pumice
#

mmmm, damn

olive mortar
#

still has it as bigger values too, just masked, but makes the camera rotation un-usable

#

so theres something else going on

spark pumice
#

I g2g. but this is an interesting conundrum. I'll ping you if any ideas occur to me

olive mortar
#

sure thing

#

I'll leave this here. this still does it. But if i construct a float x,y with the input.getaxisraw, and plug it straight into the rotation. it works

#

So its something with InputVectorX and Y

#

but they're just basic properties

#

public Vector2 InputVector => m_inputVector; InputVector is what is used for the camrotation in the snippets above

sullen lintel
heady river
heady river
sullen lintel
sullen lintel
remote hornet
#

I have a new powerA wired GameCube controller for switch, unity recognizes it as a switch pro controller but doesn't pick up any input in the input debugger, or when listening to set bindings. It works with windows "setup usb controllers" and even with jelly drift (with was made with unity), although the controls are a little strange. So am I doing something wrong or does my controller simply not work with unity?

sullen lintel
# heady river

u took a video of the animator and not the walk action character in game 🤔 🤷

olive mortar
#

ok. so i've tested again with the old input system, and its also jumping. so i was wrong

#

theres something fundamentally wrong here. im checking on the old branch with rewired now

#

yep. rewired is perfectly fine. no jumping

#

and it was literally just this. Ran in update

#

Nothing funky with it. So why is the input system just shagged

#

I found the cause! :DDD

austere grotto
olive mortar
#

my gamepad inputs was interfering for some reason. i need to find out why its not disabling when no gamepad is in use

#

a script i have for UI behaviour on gamepad

#

Why does WasPerformed and WasPressed this frame not act like GetButtonDown?

#

How can i simulate this behaviour without adding this:

austere grotto
#

you could do if (myAction.phase == InputActionPhase.Started)

olive mortar
#

ah i see.

#

would i need an else to set it back to true then?

#

movementInputData.JumpClicked = context.action.phase == InputActionPhase.Started; or just this

#

this does nothing, the actions wont trigger :p

austere grotto
#

or if (context.started)

olive mortar
#

thats how i had it before. Still need the = false after registering the keypress

olive mortar
#

i just want the bool to be true for a frame. then go back to false like how GetButtonDown works

austere grotto
#

wait so

#

you're using an event

#

to set a bool

#

and then checking the bool in update?

olive mortar
#

Yes

austere grotto
#

why not just check the action in Update directly

olive mortar
#

im not sure how this solves the problem

#

these are button presses, Events are the way to go, no?

austere grotto
#

sorry I'm only really half paying attention here

austere grotto
#

rather than having a event to set a variable which you then poll

#

the point of the event is to avoid polling

olive mortar
#

I guess i can change them to UnityEvents? I don't see how i can reference everything i need to do in the action

austere grotto
#

that could work

remote hornet
#

why does my power a wired gamecube controller not work with unity

#

is this a known issue

#

am I doing something wrong, my game works with keyboard controllers

#

controlls*, I am using the new input system

olive mortar
#

if you dont get a debug, when you switch, its not being recognised

remote hornet
#

It is being recognized, on the input debugger in the player input component it is listed, unity knows it is there, it just doesn't know how to interpret it

lament roost
#

How can I check if any gamepad is connected with the new input system?

heady river
#

No walking animation is playing simply the idle animation

olive mortar
lament roost
lament roost
heady river
lament roost
#

lol

#

I doubt that it would ever be over 100 mb.

sullen lintel
#

And yes use screen record next time. That shit made me nauseous with all that camera movement

heady river
sullen lintel
sullen lintel
heady river
#

and it works

#

no strings attached it 100% works

#

thank you null

tame oracle
#

I have an issue that is probably simple but I am just having trouble getting things setup properly.
This is concerning local multiplayer using the Multiplayer Event System and Input System UI Input Module.

Basically, I am trying to setup a character selection screen ( think fighting game such as street fighter or tekken etc ).
The issue is I am unable to have 2 players control icons on the same canvas.
If I duplicate the canvases (which feels really redundant) everything works fine..
But if the Player Root on the Multiplayer Event System is the same canvas only player 1 will receive input. Player 2 icon will not detect anything.

The hierarchy is PlayerSelectorIcon => which contains Device Assigner Script, Multiplayer Event System, and the input module. And one of these objects exist for both players.
Once again, this setup works fine with 2 canvases that are stacked on top of each other. But not for a single canvas so I am looking for tips or advice.
I can provide screenshots, gifs, or code or whatever is requested. Although the code is just a couple lines for explicitly assigning devices while testing.
Thank you in advance.

tame oracle
#

oh. well. I figured it out? Apparently if I don't assign the canvas (or anything) to the Player Root it works? Well that is interesting!

glad flower
#

Hey all, I got an issue where I can't bind any inputs to WASD or Arrow Keys. This issue popped up when I updated my project from the 1.3 to the 1.4 input system. I can confirm that the issue is not related to my scripts or the player input map itself, because I can rebind the button to anything other than WASD and Arrow Keys without much of an issue. I believe it is somehow related to some project setting, but am honestly lost on what.

little haven
twilit siren
#

Hey, I got an issue with the walljump mechanic: to do so, I kinda deactivate my movement rb.velocity set, so I can use my walljump rb.velocity set instead
But the issue is that if I walljump from a wall at my right for example, and I want to go to the left, I'll press left instantly after pressing jump, it won't "register" the left input because it's been pressed while rb.velocity was handled by the walljump method

In the video, I pressed right just when the movement method was back to handling rb.velocity, so it worked, and in the second jump I pressed right while rb.velocity was handled by walljump method, so it didn't work and you can see that it just kept in memory the last input before switching the rb.velocity handling, which was left, so the character just keeps going left even though I press right, because there's no new event that changes the input value again (problem is non-existent on a controller unless you're super precise)

#

Using Unity Events

#

Not sure code is needed here it's more of a logical issue, but if needed let me know I'll share it

twilit siren
#

I got the same issue with my dash apparently, because it works the same way, the Dash() method handles the velocity for a certain amount of time, and if I input a movement key while dashing, it won't take it in account and continue until another even happens

#

Even the cancelled event is not heard, if I release my right key during a dash, it'll just keep walking when the dash is over

glad flower
#

Nevermind, I found the forum post 🥲

limber gull
#

does anyone know where i can find the list of input paths (newer input system) of oculus controllers?

limber gull
#

can different action maps with the same input be active at once and still work?
having trouble with one of my buttons not triggering a method but it triggers another one (same button bound)

runic anvil
#

Very basic question, anybody can point me in the right direction? I want to know how many times a button was pressed since the last frame (not just wasPressedThisFrame).

limber gull
#

how is a user supposed to press several times in 1 frame?

runic anvil
limber gull
runic anvil
alpine umbra
#

or at least, Unity will not register it

runic anvil
alpine umbra
runic anvil
# alpine umbra it's polled but is just not available to you

I was wondering if there might be some functionality via eg AccumulatateValueInEvent() or other similar cryptic methods possibly through comparison with a pointer of the state from the previous frame - do you have enough familiarity with the input system that you have a high degree of confidence about that?

alpine umbra
runic anvil
alpine umbra
#

And in fact, the more often you poll the slower your frame rate will be

#

that says it all

runic anvil
alpine umbra
runic anvil
# alpine umbra but what would you do with it? There is no mechanism within unity to consume and...

What would we do with it? If the buffer contained multiple events, process them. If the buffer didn’t store multiple and/or Unity provides no interface to get at it then of course, we couldn’t do anything with it. To know a key is released in the same frame it was pressed, I assume this data is theoretically available. The questions I have are, a) is the multiple key press data in the internal unity buffer at any point or does the buffer only store state eg per key per frame, b) if the data isn’t stored, is this a suitable request to make via the forums, c) if it is stored, is there really no api access (in which case, we would request) or is it that it requires the undocumented low level apis and it is actually all there to access. From your responses I gather you think this is flat out impossible- either Unity can’t get this data or would never expose it - correct?

alpine umbra
urban forge
#

how do I make the rebind actually work? I can't understand it, I was following a tutorial and I added a function I made a while ago, it works fine with the default and the rebind ui updates, but the key for the function doesn't

austere viper
olive mortar
#

Anyone encountered where some UI doesnt work with the new input system?
some buttons and all Dropdowns dont... drop down
its like the click event just doesnt work, hover, press colour works fine

olive mortar
#

this is what i got

#

oh, i see input actions

#

i should change it to the one i made

austere grotto
#

That should be good assuming you haven't messed with it or with that default actions asset

#

Usually leaving on default is fine. Strange that the hover would work but not the click

olive mortar
#

the click changes the Pressed Color on buttons and dropdowns, they just dont function

#

i debugged in my OnClick event, and it doesnt register

austere grotto
#

If that's happening though I'd lean on it not being an input problem

#

Since the input is clearly being detected

olive mortar
#

its an odd way its being done, and dont grill me for it. this is how i know its not detecting:

#
    public void Start()
    {
        Button[] buttons = FindObjectsOfType<Button>();
        foreach (Button b in buttons)
        {
            b.onClick.AddListener(new UnityAction(() => ActionButton.ButtonPressed(b.gameObject.name)));
        }```
#

It doesnt debug anything when clicking some buttons

austere grotto
#

Ok do

#

So*

#

That for loop

#

Definitely has a variable capture bug in it

olive mortar
#

i do not know what that means

austere grotto
#

Or it might anyway

#

One sec

reef hound
#

Can someone give me the script to control a player?

olive mortar
#

download the unity starter assets

austere grotto
olive mortar
#

i cant add two listeners? i need the first one to actually log me in, to test the broken ones

olive mortar
#

ah, i had collapse on

#

no, its not debugging Clicked on the broken buttons

austere grotto
#

or they get activated later?

#

because... FindObjectsOfType<Button>(); will not find deactivated ones, or ones that aren't spawned in yet

olive mortar
#

all the buttons are in a prefab. that prefab is the entire games UI, all objects are enabled to begin with

#

oh, i know why dropdowns arnt working, i changed them all to TMP

#

let me check if they now work

#

No, they' don't work

dry olive
#

I can't figure out how to change this so it's not always true lol

olive mortar
#

well, they are the same

austere grotto
dry olive
#

I also don't understand why I can't find anything on google to just detect if the damn mouse is moving

#

feel like i'm taking crazy pills

austere grotto
#

right now you're comparing the position to the same frame

austere grotto
olive mortar
#

@austere grotto Looks like the FindOfType isnt finding them

#

i debugged the array

austere grotto
#

that's why I was confused about the "login" comment you made

#

it implied that the other buttons were nonexistent or at least not enabled when you ran FindObjectOfType

dry olive
#

thank you!

olive mortar
#

ok cool! Buttons are working now! 🙂 Dropdowns still dont thinkfused

runic anvil
olive mortar
#

Do dropdowns only assign their data when they're enabled at runtime? i just tried to enable them manually in the editor, but there is only one value. Option A

#

i would think they would still be able to drop down though

olive mortar
#

ok very strange. the dropdowns wont dropdown if they are under a specific canvas

austere viper
olive mortar
#

@austere grotto fixed it. i had the canvas sorting order to int.max. which apparently breaks it Shrug

olive mortar
#

you should delete the components not needed for remote players

austere viper
#

ok ty

limber gull
#

need some advice on my input system
i want the player to be able to choose if they are right/left handed and i want my input to change accordingly (vr game)
to make things organized, i put the different parts of player controls into different action maps
but since just changing the input action asset to another one in player input doesnt change what events will be triggered, im not certain at what to do

the only way i can think of to make anything work with right/left handed is to not use several action maps for the different actions
but rather to have all actions in each action map but switch the side (right or left controller) on the action maps
and then disable/enable action map from the players choosing

i need these action maps to change what control they listen to

limber gull
#

ended up making 2 different rigs with its corresponding actions
if there is a better way, please let me know

echo estuary
#

Anyone have experience with the Player Input Manager and Split-screen? I intend to have split-screen supporting 1 to 3 players and I was wondering if it's possible to give the 3rd player the entire bottom half of the screen. Currently I'm forced to use "corner screens" and in a 3 player game you're left with an unused screen in the bottom right corner. Is it possible to combine the 3rd and 4th screen into one large screen? Thanks!

limber gull
#

@echo estuary you can change the size and position of all the cameras you have active giving you full control

echo estuary
#

@limber gull Do you mean adjust them using the Player Input Manager's split-screen settings or on the Camera itself? Edit: I'm now messing with my 3rd camera's Viewport Rect and that seems to be working.

limber gull
celest orchid
#

So I just downloaded my project from Plastic SCM and now when I run my game I get a null error from Mouse.current.position.ReadValue(). Is there a reason why any of those would be null?

austere grotto
celest orchid
#

Hmm, ok, so something else might be wrong then since my mouse is definitely plugged in

austere grotto
celest orchid
#

Yeah

#

It seems like position is the value returning null

urban forge
#

wait, is there something between the rebind ui and my action I need to manually update?

#

cuz the ui is annoyingly working fine except it isn't updating the action, and the action works

#

this the new input system

true ivy
#

With the StandaloneInputModule for UI there was this nice list of debug info (current mouseover, last click etc). Was this moved somewhere with InputSystemUIInputModule?

urban forge
#

or is that not what you were asking

true ivy
#

no, I switched from Standard IM to the new one, but all the debug info is gone in the new version

urban forge
#

but I still don't understand, hitting "B" (my default key) does exactly what I want, hitting the rebind ui and choosing a letter updates the text on the ui, but doesn't update the action

true ivy
#

oh, sorry, I wasn't answering your question, I'm asking another one 🙂

urban forge
#

oh lol

#

I got confused

halcyon oak
#

any one knows how to move two characters using the new input system, I'm making a game like firegirl and waterboy, so far I can only get 1 character to move

twilit siren
#

Hey, I'm using this code to move my character with acceleration and deceleration https://paste.ofcode.org/cjiJZhuAjM2jSJxBFpWrPM

The problem is that it doesn't work if I switch direction, it'll stay at max speed, it won't decelerate then accelerate again because the deceleration phase is only called on context.canceled
Any idea?

olive mortar
#

shouldnt deceleration be currentSspeed -= deceleration... ?

twilit siren
#
  • is already applied there
olive mortar
#
return replacement.ActionReference.action.GetBindingDisplayString();``` How do i get the controller binding here? this works for keyboard, as its the first index. (0) but controller is second index. I'm unsure how to get this index
olive mortar
#

hm. what i wrote just works 😅 WorksOnMyMachine

olive mortar
#

anyone come in contact where input isnt recognised sometimes in the editor? as soon as you press play, but sometimes it is

limber gull
patent hill
#

Hey, what would be the closest mouse binding in the input system that simulates what the old input manager used for "Input.GetAxis("Mouse Y")"?
the options are delta, position, and radius

patent hill
dire quartz
#

i'm using delta with cinemachine it works flawlessly

patent hill
#

how do processors work? i want to make the input value be between -1 and 1, but when i put on the normalize processor on both the action and the binding and it still seems to spit out bigger ints

dire quartz
#

hmm not sure about the look delta though never bothered to check the values

#

i'm only familliar with the processor scale vector which speeds up or slows down the speed of the rotation

patent hill
patent hill
spark pumice
#

normalizing it doesn't make sense

patent hill
#

yeah i figured that out, i found out how to emulate getAxis()

#

you just grab the delta y and mult it by 0.1 and you get close enough behavoir

#

didn't matter in the end tho because the implementation i was trying to use didn't work for my application, sadly

#

but thank you!

elfin radish
#

get value of right and left trigger (dualshock 4)? please help

vocal jay
#

I have a movement action that used to work, but now it somehow broke, and I can't figure out why, this is what the action looks like

#

It's mapped to the correct control scheme

#

and the active user has this control scheme set and devices registered

#

the action is active

#

But I get no input from it

#

I have another action in the same ActionMap that works fine

#

The same action works using the gamepad control scheme (mapped to left stick)

austere grotto
vocal jay
#

I'm just reading the value

austere grotto
#

from where?

vocal jay
#

I create the input system in code

austere grotto
#

HOw are you fetching the input action? Is it declared directly ony our script? Is it part of a generated C# class? Are you using PlayerInput?

#

etc

austere grotto
#

Did you ever Enable() it?

vocal jay
#

It's enabled, it would also say Disabled in the screenshot above otherwise

#

_System = new InputActions();
IS.System.Gameplay.Move.ReadValue<Vector2>()

#

Reading it works fine if it uses the gamepad for some reason, it won't read if it uses the composite 4 way keyboard binding

vocal jay
#

Ok, something is definitely weird, only WASD isn't working. Binding multiple composites to the action triggers on all except WASD

#

They all appear as registered to the current user, and they all work, except WASD

#

the strange thing is, WASD appear in the device events just like all the other keys

#

no idea what is going on

vocal jay
#

Everything works fine on input system 1.3.0 (I was on 1.4.2 previously), so I'm assuming this is a bug, although I can't believe that I'm the first to notice this...

hollow eagle
#

Hi ! Is there a way to add a setting for the mouse to have no limit with the screen size with a Virtual Camera? because the cursor stops at the limit of the screen so it's not in 360 degrees, it's very limited..

hollow eagle
dire quartz
vocal jay
#

I don't have any errors, but like I mentioned, for some strange reason WASD doesn't work on a composite binding

dire quartz
vocal jay
#

Yeah it works on 1.3.0

#

Can you share the link to the issue?

dire quartz
vocal jay
#

Awesome, thanks. And yeah I am using multiple control schemes so I guess it's the same issue

dire quartz
#

its the same error i had and i also had multiple other errors

austere grotto
hollow eagle
hollow eagle
#

@austere grotto I remember for the mobile. When we use the Left Pad to control the character, the camera movement is activated too. It seems that anywhere on the mobile screen, the camera movement is enabled so when you move the character the camera moves too, it's annoying...
and I don't know why because there is a right pad for the look around camera and I didn't use the Touch screen input system, only the Joystick input system.

And it's only if the Cinemachine Input Provider is activated too. If I deactivated it, in Mobile it's okay, but on Desktop, the look around is only on the left/right. No more different angles with the 3 rigs of the Free Look Camera Settings. It makes me crazy xD
Any ideas?

lament roost
#

How can I use these instead? I'm using the rebinding UI toolkit.

dry olive
#

Took me so long to realise this is not working because aButton is not any button.. sheesh does input system not have anything for this?>

vernal egret
#

I am attempting to create a 2D platformer with a dash function similar to games like Celeste and Katana Zero. However I have run into an issue where while inputting using a gamepad works fine, using a mouse causes the player to only ever dash to the right and up. I understand this is because mouse position treats the bottom left of the screen as (0,0), but I do not know how to fix it. Below is my current code for the input using Unity's new input system. I attempted to fix the issue using WorldToScreenPoint, but this actually didn't change anything. Any help would be greatly appreciated!

     public void OnDashDirection(InputAction.CallbackContext context)
     {
         var dir = Camera.main.WorldToScreenPoint(context.ReadValue<Vector2>());
         if (dir.x == 0 && dir.y == 0)
         {
             dir.x = sr.flipX ? -1 : 1;
             dir.y = 0;
         } 
         dashDirection = dir.normalized;
     }
austere grotto
vernal egret
#

the direction from the player to the mouse world position, but how do I do that?

austere grotto
vernal egret
austere grotto
#

Joystick represents a direction directly

#

Mouse position represents a position that needs to be transformed to world space and compared with the player position

#

You'll need special handling

vernal egret
#

ok that makes sense. thank you very much, first person to actually give me an answer lol

upper tapir
#

sooo the warriors example doesn't work with my capsys gamepad

#

when I plug it in it says twin usb gamepad plugged in

#

but it doesn't work when I launch

upper tapir
#

update: it detects my controller as a joystick

upper lance
#

@lament roost found any solution?

upper tapir
#

I finally figured it out

rapid jetty
#

how do i install it it keeps saying error and it is pissing me off
i have been trying for the last 30 munites trying to install it
pls DM me if you can help!

rapid jetty
#

I fixed it

#

Nvm

lament roost
upper lance
#

To put images

edgy osprey
#

What are the current thoughts regarding input system vs rewired?

faint oak
#

is there an input system component i can add on to my player for movement, or is it just better to use an enum?

austere grotto
faint oak
#

I’ll figure it out forget about me despair

austere grotto
#

Sorry I just don't understand what you're asking

faint oak
#

It’s probably my lack of understanding, I’ll look into it more and then ask if I have any questions still

half mantle
#

how to fix this?

half mantle
cursive tulip
#

Why does not list me the keyname: "MyTestKey" ?

austere grotto
cursive tulip
austere grotto
half mantle
#

alr

austere grotto
#

PlayerActionControls vs PlayerControls

half mantle
#

wat now

austere grotto
#

Now fix that

#

It's not valid C#

#

Variables need names

#

You only have a type

#

See how the one above it has a name?

half mantle
#

so i remove the .

cursive tulip
half mantle
#

and add a space

austere grotto
austere grotto
#

then you broke a bunch of it for no reason

half mantle
#

i fixed it again

#

now were at the same error

#

this

austere grotto
#

you were one word away

#

from it compiling

#

idk why you changed so much other stuff

#

oh and line 16 you had the wrong name there too

#

idk this is... just

#

you'd be better off starting fresh

#

from a basic C# syntax tutorial

#

you're making really basic errors right now

half mantle
#

thats another script

#

i fixed that one

cursive tulip
austere grotto
#

it's a different asset

cursive tulip
#

I did not called PlayerControls

half mantle
#

its not the same code

#

this one is inputmanager

austere grotto
half mantle
#

the other one is player motor

#

look at the names

#

theyr diffrent codes

austere grotto
#

Yes

#

and you're making incredibly basic errors

#

You need to learn to crawl before you can do gymnastics

half mantle
#

ik i havent watched any tutorial

#

but i will in like 2 hours

pulsar mist
#

can i not have more than 1 of these components in my scene? I have one on my player, on another script and on the interface. After switching to another pc it seems that I can't get the interface one to work properly

austere grotto
pulsar mist
#

then why does it not work?

austere grotto
#

not sure what "on the interface" means though

austere grotto
pulsar mist
#

i tried adding it in again by removing and pasting it in, but now the player doesnt move!

pulsar mist
half mantle
#

alr how about i just give u my code and u fix it

#

and send it back

#

lmao

austere grotto
#

what am I your employee?

cursive tulip
# austere grotto See how this asset is called PlayerControls? But the class you are using is Play...

Where I called PlayerControls?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class TEEEEST : MonoBehaviour
{
    private int MyRandom;




    private PlayerActionControls _controls;
    private void Awake()
    {
        _controls = new PlayerActionControls();
    }

    void Update()
    {
        bool _ButtonPressed = _controls.Player.

        //if (_ButtonPressed == true)
        {
            MyRandom = Random.Range(0, 5);
            print("My random number is = " + MyRandom);
        }
    }
}

There is not a single line of PlayerControls...

half mantle
cursive tulip
austere grotto
#

you showed me a screenshot of an asset called PlayerControls, but in your code you're using PlayerActionControls.

pulsar mist
#

it worked fine on my other pc

austere grotto
#

I would only expect MyTestKey to appear in PlayerControls. Not PlayerActionControls

pulsar mist
#

also my post processing isn't working anymore

#

not even on the editor camera

austere grotto
pulsar mist
#

what info do you need?

#

i am using Player Input components and activate unity events to do stuff in my scripts, thats all

austere grotto
#

show the unity events

#

show the code

#

show the Debug.Log statements you added to debug

austere grotto
cursive tulip
#

and it also shows me the same actionsbut not my new action

pulsar mist
cursive tulip
#

MyTestKey is not included

austere grotto
austere grotto
#

because you haven't yet afaik

pulsar mist
#

10 minutes ago my player was able to move, but i couldnt open the ui, now it's the other way around...

cursive tulip
hollow eagle
#

Does anyone knows well the Starter Asset Pack? I really need some help to fix something pretty easy I think

austere grotto
cursive tulip
#

Because it is also used on my other script where I copy it from:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;


public class CameraZoom : MonoBehaviour
{
    private Camera myCamera;


    private void Start()
    {
        myCamera = GetComponent<Camera>();
    }
    ////////// New Input System Anfang //////////////////
    private PlayerActionControls _controls;
    private void Awake()
    {
        _controls = new PlayerActionControls();
    }

    private void OnEnable()
    {
        _controls.Enable();
    }
    private void OnDisable()
    {
        _controls.Disable();
    }
    private void Update()
    {
        bool _ButtonPressed = _controls.Player.Camera_Zoom.ReadValue<float>() != 0;
        //Debug.Log("Update Inhalt: " + _ButtonPressed);
        if (_ButtonPressed == true && myCamera.fieldOfView > 30f)
        {
            //Debug.Log("rightclick-zoom ON!!");
            myCamera.fieldOfView -= Time.deltaTime * 70f;
        }
        if (_ButtonPressed == false && myCamera.fieldOfView < 60f)
        {
            //Debug.Log("rightclick-zoom Off...");
            myCamera.fieldOfView += Time.deltaTime * 70f;
        }
    }

}
austere grotto
#

where did it come from?

#

Why is the name different from your input actions asset?

#

Seems to me it's probably a leftover script from before you renamed the asset or something

cursive tulip
#

it is also using "PlayerActionControls" without problems. so why not my current one?

austere grotto
#

Can this other script access _controls.Player.MyTestKey?

#

If not, it has the same problem

cursive tulip
austere grotto
#

you should be using PlayerControls not PlayerActionControls

#

everywhere

#

PlayerActionControls seems to be some leftover thing

cursive tulip
#

what is the difference?

austere grotto
cursive tulip
#

is this a Unity bug?

austere grotto
#

No

#

it's a bug of you didn't clean up your old script

#

PlayerActionControls is some leftover thing I would guess from before you renamed the asset or something

cursive tulip
austere grotto
#

click on your PlayerControls asset

#

look at the inspector

#

there are options for generating the C# class file

#

make sure it's being generated and check where it's being generated

cursive tulip
#

what should be generated?

austere grotto
#

A C# class file...

#

you know... literally the thing we've been talking about this whole time

#

The PlayerControls or PlayerActionControls class

cursive tulip
#

IDK why my other scripts are still working, if there is no PlayerActionControls. inside of my project

#

Wait, is "PlayerActionControls" not a piece of codeline?

#

and not a file

austere grotto
#

you can just right click it from any code that uses it and say "go to definition"

#

it will take you to the class

austere grotto
cursive tulip
#

DAMN

austere grotto
cursive tulip
#

PlayerControls.cs

public partial class @PlayerActionControls : IInputActionCollection2, IDisposable

austere grotto
#

You should be able to do this with any type

#

ok so if you look at your inspector for your PlayerControls asset

#

can you show a screenshot of that

cursive tulip
#

PlayerControls.cs is PlayerActionControls

austere grotto
#

ok good, now we're making progress

cursive tulip
#

And I still have no glue what to happen now. where is the problem? why is it not showing the: "MyTestKey"

austere grotto
#

it will help

sullen lintel
#

what does your script setup look like

pulsar mist
#

the ONLY thing that changed is the pc i am using

cursive tulip
austere grotto
#

it's an inspector

#

it has no lines

austere grotto
cursive tulip
#

@austere grotto

pulsar mist
#

Fixed it! Turned out unity was recognizing a non-connected dualshock controller and that somehow caused the issue with the Player Input components going all wonky

austere grotto
#

not this

#

your PlayerControls asset

austere grotto
#

look at the inspector for it

#

Select the asset, look at the inspector

hollow eagle
#

@austere grotto you seem to know pretty well the input system, any chance to help me with the Starter Asset Pack? it's a stupid issue, but I can't find the answer..

austere grotto
#

in Assets/Game/ there should be a PlayerControls.cs file

#

so you should have a PlayerControls class

#

that class will have the new test action you added

#

but I think you should delete the existing PlayerControls.cs

#

it seems like it's not overwriting it properly

cursive tulip
#

And what is with all my keys inside of it?

ivory latch
#

I recently tried upgrading my project from Unity 2021.3.X to 2022.1.X and noticed that I could no longer click on UI Toolkit dropdown menus. After isolating various gameobjects, I found that it was the legacy event system preventing the dropdown from being clicked as once it was disabled, the dropdown worked. However, I need the legacy event system to allow the traditional UI elements like buttons to work as I still need some world space elements. Is there some configuration I'm missing to allow interoperability of the legacy UI input/event system with the new UI Toolkit system? I've already set the input system to both in player settings and recreated the behavior in an empty project so I don't believe anything from our codebase is conflicting. Any help would be much appreciated and if this should go into a different channel, I'm more than happy to move it.

olive mortar
#

when setting up your keybinds in the input action asset. for a playstation controller. does anyone know why ButtonSouth [Gamepad] is actually ButtonWest [Gamepad] for playstation controller? works fine for xbox...

olive mortar
#

Nothings coming up on google, perhaps my phrasing is wrong, if someone can help let me know 🙂

ripe plover
#

hi everyone, does anyone have an idea why when i hit play. I just have the keyboard working. I went to the Input debug and I have my gamepad connected

ripe plover
#

I have my control detected but when I try again to listen to an input it sends me nothing 🤔

#

ok I changed the cable it worked no idea why because in the debug input they already appear

sharp geode
#

is there a way to increase the amount of memory available for events queued from non unity managed threads?

#

i get "Could not allocate native memory" errors

#

"Assertion failed on expression: 'gCurrentManagedTempMem != NULL'"

#

i see there is a bug report claiming this was fixed, but it was not, or i simply get a lot of events

sharp geode
#

i am definitely not making that many events

#

nvermind it's a bug in input system

sinful lotus
#

Ok, going to try this here since I think this counts as an input system. Open/Close file dialogue box during runtime, is there an easy option without me either consuming someones github library or having to build the entire UI from scratch?

sharp geode
sinful lotus
#

fair enough

#

thanks

spare igloo
#

Hellooo

#

Why do i dont see

#

the vector system

limber gull
olive mortar
olive mortar
#

i dont really know how to research this, every phrase i use just gives me generic InputSystem documentation

limber gull
olive mortar
#

updated input system to 1.4.2 and getting this spammed when i exit playmode, not causing problems, though this didnt happen in 1.3.0, anyone know a fix just to save my sanity?

limber gull
olive mortar
#

Well yes, but that's just hiding the problem

limber gull
#

Well, it gets rid of the error
As u said, it doesnt hurt, only annoys

austere grotto
#

(if you're using that)

olive mortar
#

no not using the class, just the asset

cursive tulip
# austere grotto there you go so

OK, I remade now the entire new input action file. but It still doesn't show me the code example in visual studio. it still shows me my old actions with no sign of my new action that I called now: "MeinTestButton":

mighty field
#

can someone help me to assign a "forward" button?

austere grotto
#

use the generated C# class for the new C# generated class you made

#

You didn't need to remake the input actions asset

#

just delete the generated C# file

cursive tulip
cursive tulip
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;

public class TEEEEST : MonoBehaviour
{
    private int MyRandom;




    private MeineInputActionBelegung _controls;
    private void Awake()
    {
        _controls = new MeineInputActionBelegung();
    }

    private void Update()
    {
        bool _ButtonPressed = _controls.Player.MeinTestButton.ReadValue<float>() != 0;

        if (_ButtonPressed == true)
        {
            MyRandom = Random.Range(0, 5);
            print("My random number is = " + MyRandom);
        }
    }
}
ember spade
#

Hello , I am having some hard time with programming 😂 , basiclly I am making pre jump to work , I pull my gamepad right stick down = player plays prejump animation and when I release it it jumps in the air , the problem is I just cant get isGrounded function to work with my code , I tried multiple ways to do it but It just wouldn't work , if anyone here has time to help would be nice 🙂 , here is the code link https://pastebin.com/0LKJhteq

#

I am using new input system

ember spade
cursive tulip
austere grotto
#

Enables it

cursive tulip
# austere grotto Enables it

ok that fixed it. wow.
but a second problem was, I have a script for my ESC settings menu. the problem is, I am not sure anymore, how that input system things work, so that it can detect, if I press "ESC".
It did work earlier, but no longer for a time and I am not sure why. the important part of the script is, where it detects if I press "ESC" and to enable, disable a Gameobject:

cursive tulip
#

The:

 public void NewInSy_ESCReturn(InputAction.CallbackContext context)

part is the weirdest. I took a look on a older backup where the ESC menu did still work and they look like same.
How does the script detect the ESC button?

austere grotto
austere grotto
#

that's where the escape button may be bound to the action

#

but you need to hook the action up to your code somehow

cursive tulip
#

ESC_returnButton is the one that should be used because I have to use them for Keyboard, Gamepad and VR Controller

austere grotto
#

ok?

cursive tulip
#

does it have a reason? - What is that?

austere grotto
#

it;s part of the method declaration

#

not sure what you're asking

cursive tulip
austere grotto
#

because ... it doesn't?

#

That example is polling the input value in Update

#

a method like public void NewInSy_ESCReturn(InputAction.CallbackContext context) would be used for handling input events

cursive tulip
austere grotto
#

which is a different approach to input handling

austere grotto
cursive tulip
austere grotto
cursive tulip
#

Is there somethign missing in my code? Because the Thing I dont understand is, why is it working in my old backup, with closely the same codelines?

austere grotto
cursive tulip
#

I have to press ESC on my keyboard to trigger it.

#

maybe it was a try of me to handle the ESC Settings menu button without an performance hungry "Update" event.

#

so...

#

I need to trigger it if something happen on my keyboard and not after every frame

austere grotto
#

Right that's the whole point of event-based input handling

cursive tulip
#

it must be 2020 where I was at least on this script

#

working on it.

cursive tulip
austere grotto
#

I no longer have time to explain here.

cursive tulip
#

thats something, but not that what I search for.

#

I dont get it, its like, its not happening inside the code, but also, something is missing in the code.

#

It's really confusing.

austere grotto
cursive tulip
cursive tulip
cursive tulip
#

I dont evne know what to search for because all this newbie guides are not handling this stuff of advanced input system stuff.

#

what is a "Unity Events mode" and how does look a: "event from an input action"

#

It's like I lost my memory....

austere grotto
#

the second one is just a basic C# language feature

#

and InputAction is a class in the Input Sytem

cursive tulip
#

did I miss a drag and drop field in the insprector?

cursive tulip
austere grotto
#

I've told you like 20 times the answer to that

#

it's like there's a brick wall of you not wanting to listen/understand

#

so I'm not sure what else to say.

#

o watch some input system tutorials with an open mind and dispel any preconceived notion you have about how it's supposed to work.

cursive tulip
#

is it that?

#

"Behavior" ?

austere grotto
#

that is the invoke unity events mode yes

#

from there you'd expand the Events thing and assign your functions there

candid bramble
#

Hey, I lost my InputActions file. (moved my player prefab between projects and I only have the generated script)
Is there any way to generate the file back through my existing inputMaster script?

austere grotto
candid bramble
austere grotto
#

you can examine the json in it and manually rebuild

candid bramble
#

I will probably recreate it than, Thanks!

thorn crag
#

So I'm starting to learn Unity and I'm trying to make a basic FPS rigid body movement system

#

I'm using the new input system

#

And I've made the Input Actions map and generated the C# file

#

I also have my own PlayerMove file where I would control the movement, but I'm unsure as to how I can control the movement of the player

#

How to use the input actions map's keys to then change the velocity of the rigid body

#

And what the best way to change the velocity of it would be

upper tapir
#

guys, I've been wondering how I can change my button UI based on current controller, for example, if you're using an xbox controller the UI image changes to xbox button

#

I just need a general idea on how it works, I don't have a specific case

pallid gale
#

Is it possible to set an input action to explicitly have no modifiers? So if I set up an action that's bound to the key A, can I say that if shift, control or alt are pressed then that means the action is cancelled? And if I press ctrl-A nothing will happen?

austere grotto
pallid gale
#

urgh, ok thanks

rough sleet
#

Does anyone know how can I set the control scheme in code whith the generated C# class rather than the player input component?

rare wadi
#

Hello I would like the touch field to be delimited because when I move with my joystick it moves the camera which is very disturbing

cursive tulip
#

Why does:

    public void NewInSy_ESCReturn(InputAction.CallbackContext context)
{

}

not get executed, if I press "ESC" on my Keyboard?

#

I though this is a way to run a function only, if the key was pressed and not checking it in every frame, like it would be with an if statement inside of a update function.

short granite
#

How would I specify the input for grbbing

#

onfoot hit

#

what code should I make so that I could use the hit input

olive mortar
#

Why does the input system allow you to use the Input Action SO but also the option to use a generated class?

#

im using the SO. is that bad? why would you use the generated C# class?

olive mortar
#

for a callback

austere grotto
#

with compile time checking

#

which is pretty nice

olive mortar
#

can you explain "compile time checking"

austere grotto
#

If I write the name wrong

#

I get a compile error

#

I also get intellisense etc

olive mortar
#

oh, well i use the inspector callbacks so i dont think i can get the names wrong

austere grotto
#

as opposed to myInputActionAsset["MyActionMap/MyinputAction"]

austere grotto
#

or what

olive mortar
#

yea

#

but if i want to rference a specific action, you can do public InputActionReference shootAction;

#

for example, and jsut drag in the action you want

austere grotto
#

The input system has about a million different ways to use it, which is both a blessing and a curse

#

it's amazingly flexible, and also incredibly confusing to newcomers

olive mortar
#

i see, was just wondering if i made the wrong choice or not, doesnt seem like it. which is nice, thank you 🙂

hot field
#

If anyone's using the Steam Deck as a build target for their games, do you know what the controller buttons come up as? Does Unity see it as Xbox 360/One/XInput Controller? Or does Unity know it's "special" and detects it differently?

olive mortar
#

what does this mean? its when the player is created with the input on it, seems to work, but just get this error sometimes

mild orchid
#

Using the new Input System on Linux to orbit the camera around the player. Issue is that the orbiting stops when the mouse reaches the edge of the screen.

Found this post: https://forum.unity.com/threads/cinemachine-free-look-camera-not-rotating-360-degrees-on-linux-editor-or-builds.1085396/
The OP said that they changed the input package to 1.0.1 however I'm unable to do that with the package manager

cursive tulip
raw sonnet
#

I have a Player Input Manager set up like this, and 2 Keyboard control schemes (left/right, for local multiplayer). Each of those schemes has a separate binding for Join. But when I press keyboard right's join binding, the Player Input always uses Keyboard Left. Anyone got an idea what I'm missing?

raw sonnet
#

PlayerInput Shared Keyboard Control Schemes for Local Multiplayer

olive mortar
vocal helm
#

Hey, how can I use the "GetBindingDisplayString" function to get the bindings for these composite bindings?

#

I know normally you can do playerInput.actions["Jump"].GetBindingDisplayString(), but that only works if the action doesn't have composite bindings.

amber ruin
#

okay so I'm trying to learn the new input system, in the doc's example they check for a controller every fixedupdate

 void FixedUpdate()
    {
        var gamepad = Gamepad.current;
        if (gamepad == null)
            return; // No gamepad connected.

isn't that something that should be done in start so it's not having to constantly check that?

shut ingot
#

!docs

austere grotto
amber ruin
thorn cairn
#

Hello! I am following a yt tutorial on a top down RPG right now and is having some problems. I can't seem to reference the InputValue to the Unity InputSystem, It just says that there are no code actions available. Please help!

austere grotto
#

You also need to get your IDE configured so it will show you errors properly. See IDE configuration in #854851968446365696

austere grotto
thorn cairn
stiff siren
#

so I'm trying to use the new input system but I'm not getting any value on Input Debugger

#

is there anything that I need to setup?

#

I'm not getting anything from keyboard too

#

oh, I'm restarted Unity and getting now

amber ruin
#

Where can I find a list of the UnityEngine.InputSystem methods? So far I'm just finding the quick start guide and it's not listed under the main API directory

lament roost
#

Can this shit SHUT UP?

#

I'm tired of it.

olive mortar
#

its a known bug in 1.4.X, it'll hopefully get patched eventually

upper tapir
#

guys, I've been wondering how I can change my button UI based on current controller, for example, if you're using an xbox controller the UI image changes to xbox button
I just need a general idea on how it works, I don't have a specific case

olive mortar
#
        UsingGamePad = !input.devices[0].device.name.Equals("Keyboard");

        if (UsingGamePad)
        {
            IsXboxController = input.devices[0].name.Contains("Generic Xbox controller string"); (Psuedo string)
        }```

you can go one step further to get the device platform to show platform specific sprites
upper tapir
#

I don't know much about the new input system so it will be hard but at least I have an idea on how it works now

olive mortar
#

you could also probably fire an event too. which would be better

#

so if you're in menus and change input device, it'll change on the fly

#

without polling for it in Update etc

upper tapir
#

yeah

#

I'll learn more about the input system events

upper tapir
olive mortar
#

I use this component

upper tapir
#

I just need to make a system to sort the platform specific icons then update them based on the current device

olive mortar
#

I've recently learned all this myself, loads better than old input manager