Log in with itch.io to leave a comment.
New to unity, downloaded on 2022.3.4f1 with 2 errors
Assets\TopDownController2D\Scripts\TopDownCharacter2D\UI\EntityHealthGaugeUpdater.cs(4,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
Assets\TopDownController2D\Scripts\TopDownCharacter2D\UI\EntityHealthGaugeUpdater.cs(13,34): error CS0246: The type or namespace name 'Slider' could not be found (are you missing a using directive or an assembly reference?)
How to fix? And yes, Cinemachine and Input System are installed
Edit: Seems that UnityEngine.UI (Line 4) isn't a proper namespace type and removing it seems to fix it. And "Slider" (Line 13)... isn't a real thing? Did you mean SliderEditor?
UnityEngine.UI is indeed a valid Unity namespace https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.UI.html and it's a built-in package in Unity, Maybe you have it disabled in the package manager? (Window->Package Manager ->Select Package: Built-in -> Search for the package named "UI") It's strange since it's also supposed to be a dependency of the Input System package. Either way the UI elements are not really supposed to be used as-is, it's mostly an implementation example so you could just remove those files either way and use your own UI.
And the reason the type "Slider" is not recognized is most probably because you don't have the UI package not because I don't know how to type (Errors like that are usually caused by how your project is setup since Unity has a lot of package that can be enabled or disabled)
I mean that if you remove "using UnityEngine.UI" from the file that use the type "Slider" it will cause issues either way because it's the namespace that contains the "Slider" type.
Did you try to install my package on a new project? If you have Unity UI installed it should work. But it seems to be a common issue maybe you can find more info on how to solve that here https://forum.unity.com/threads/solved-the-type-or-namespace-ui-does-not-exist-i...
hi, I'm also new to unity, I downloaded this asset and I have only 2 errors
this first error
Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(30,16): error CS1503: Argument 1: cannot convert from 'UnityEngine.Vector2' to 'UnityEngine.InputSystem.InputValue'
this second error
Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(48,20): error CS1503: Argument 1: cannot convert from 'UnityEngine.Vector2' to 'UnityEngine.InputSystem.InputValue'
tell me how to fix it please
I don't seem to have any issue using Unity 2022.3, so please make sure that you :
and restart the editor afterward, if you still face some issues try to re-import the plugin after that, if even after that it still doen't work, feel free to tell me
Hey new to unity, why do i get an error when trying to Import this in?
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(2,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)"
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\UI\EntityHealthGaugeUpdater.cs(4,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)"
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\UI\EntityHealthGaugeUpdater.cs(13,34): error CS0246: The type or namespace name 'Slider' could not be found (are you missing a using directive or an assembly reference?)"
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(25,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)"
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(35,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)"
"Assets\TopDownController2D\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(54,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)"
those are the errors in question.
Hey, which Unity version are you using ? Also from what I see most of those error are caused by a missing dependency, the sample project use the new input system so it needs to be installed in the package manager and activated for those errors to go awayhttps://docs.unity3d.com/Manual/com.unity.inputsystem.html
I couldn't get it to work for a while because the new input system (even when assigning keys) wouldn't detect any presses, and playing wouldn't let me move or shoot.
The fix was:
Edit -> Project Settings -> Player -> Other Settings -> Configuration, and set "Active Input Handling" to "Both"
It worked suddenly after restarting.
In the sample project you can look at the "Player_Close" game object (which is disabled by default), but in a general case you need to add a "Top Down Melee" component to your character (in which you will need to add a reference to a prefab containing a "Melee Attack Controller" component), and changes its "attack config" in its "Character Stats Handler" component to be a Melee attack config (in the sample project there is the "PlayerSwordSlash" config. I don't know if that's what you wanted.
You could theoretically just edit the InputAction file of your Player to add ways to triggers the Move, Look and Fire events with touch controls. However i don't think just doing this would work very well so you might need some kind of virtual joystick and buttons or at least a custom version of my "TopDownInputController" script. I might try to implement touch controls later but not in the near future.
In order to add a new mechanic (something that needs a new input other than the existing ones) you have a few steps to do:
Now as for the dodge mechanic in itself i think you should use a Coroutine (https://docs.unity3d.com/Manual/Coroutines.html) which will simply disable collision between the player and enemies / bullets and some components like TopDownMovement and HealthSystem for a given time. I think this page can be a good start https://docs.unity3d.com/ScriptReference/Physics.IgnoreLayerCollision.html
If you want a specific animation for the dodge you can look into theTopDownAnimationclass and add a listener on the OnDodgeEvent.
These steps should help you to add a new mechanic to the controller, but if you encounter any problem or don't understand a step don't hesitate to ask me in the future i plan on writing a small documentation properly to answer those kind of questions.
Nice, I was looking for something like this for months, good controller.
but it gives me 4 errors when I import it
first error: Assets\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(2,19): error CS0234: The type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
second error: Assets\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(24,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)
third error: Assets\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(34,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)
and forth error:
Assets\Scripts\TopDownCharacter2D\Controllers\TopDownInputController.cs(53,28): error CS0246: The type or namespace name 'InputValue' could not be found (are you missing a using directive or an assembly reference?)
It was only mentioned in the installation instructions but its easy to miss so I added it in the description now. However if it's a problem for you, porting it to the old input system should be really easy since only the controller would need to be reworked (I might add an example with the old input system later)