Skip to content

[Standalone] InputAction.ReadValue<T> not returning casted value #230

@PaperPrototype

Description

@PaperPrototype

Describe the bug
I connected a ps4 controller to try and fly around in the Audio Demo and it throws the following error when I hold UP or DOWN in the joystick:

An exception occurred during the Update loop:
System.InvalidCastException: Invalid cast from 'System.Single' to 'Prowl.Vector.Double2'.
   at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
   at Prowl.Runtime.InputAction.ReadValue[T]() in /Users/abdiellopez/Developer/Prowl.Standalone.Preview/Prowl.Runtime/InputManagement/InputAction.cs:line 182
   at AudioDemo.AudioDemoGame.HandleCameraInput() in /Users/abdiellopez/Developer/Prowl.Standalone.Preview/Samples/AudioDemo/Program.cs:line 407
   at AudioDemo.AudioDemoGame.BeginUpdate() in /Users/abdiellopez/Developer/Prowl.Standalone.Preview/Samples/AudioDemo/Program.cs:line 356
   at Prowl.Runtime.Game.<>c__DisplayClass10_0.<Run>b__1(Double delta) in /Users/abdiellopez/Developer/Prowl.Standalone.Preview/Prowl.Runtime/Game.cs:line 71

Holding joystick UP or DOWN results in a value of 1

Image

If I let go of the left joystick (stop giving it UP or DOWN left joystick input) then the value goes back to being a vector

Image

To Reproduce
Run the audio demo and try controlling the camera with a ps4 controller.

Expected behavior
Wee fun game

Screenshots
see above

Additional context
idk wat to put here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions