Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

[Solved] ECS System Invalid Cast

Discussion in 'Input System' started by hard_code, May 15, 2020.

  1. hard_code

    hard_code

    Joined:
    Aug 29, 2013
    Posts:
    238
    [SOLVED] Got bit by the stupid same types in different namespaces again. Fixed it by making it an UnityEnigine.Vector2

    When trying to use the new input system from within an ECS system I am getting the following error when trying to read a vector2 from the context.ReadValue<Vector2>()

    My code is basically the exact same as this sample https://github.com/Unity-Technologi...ts/Common/Scripts/DemoInputGatheringSystem.cs

    When i do the exact same thing in a monobehavior it works fine. Anyone know why in an ecs system it cant cast to a vector2?

    Edit: Latest packages all around and on 2020.1.b8
     
    Last edited: May 15, 2020