playMaker

Author Topic: The type 'PlayerInput' cannot be used as type parameter 'T'  (Read 1245 times)

McPudd

  • Playmaker Newbie
  • *
  • Posts: 1
The type 'PlayerInput' cannot be used as type parameter 'T'
« on: September 20, 2021, 11:48:19 AM »
Everything was good, then I imported some skyboxes from the package manager, and when everything recompiled, I got the same error in two locations:

Assets\PlayMaker\Actions\PlayerInput\PlayerInputActionBase.cs(10,27)

Assets\PlayMaker\Actions\PlayerInput\PlayerInputUpdateActionBase.cs(9,27)

error CS0315: The type 'PlayerInput' cannot be used as type parameter 'T' in the generic type or method 'ComponentAction<T>'. There is no boxing conversion from 'PlayerInput' to 'UnityEngine.Component'.

reinstalling does not fix it, and the Playmaker tab no longer appears at the top of the screen. I've got active input handling set to both, could that be an issue?






djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: The type 'PlayerInput' cannot be used as type parameter 'T'
« Reply #1 on: September 20, 2021, 07:52:46 PM »
Hi.
Try to remove the skybox package, there probably is some script conflict there.
and try to narrow down which one

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: The type 'PlayerInput' cannot be used as type parameter 'T'
« Reply #2 on: November 05, 2021, 02:39:29 PM »
More than likely a script you imported defined PlayerInput in the global namespace. This conflicts with PlayerInput in the UnityEngine.InputSystem namespace used by the PlayerInput actions.

Deleting the offending script would fix this error (search for PlayerInput), however PlayerInput seems like a common script name that might accidentally end up in the global namespace, so I've attached a version of the actions that should work even when this happens. It will also be in the next update.