Namespaces problem

Haytam95

Active member
I'm having some with, i think that are, Namespaces at extending.

When i try to extend from Ability, the IDE forces me to make a complete import:

C#:
Opsive.UltimateCharacterController.Scripts.Character.Abilities.Ability

Here is a little animation i made:


This started to happen some time ago, i recently thought that maybe the problem was that the namespaces were not corresponding the files location, so i made a refactor to make it so:

C#:
namespace CarlaFramework.Opsive.UltimateCharacterController.Scripts.Character.Abilities

It's a little weird, because that doesn't happen with another classes.
 
namespace CarlaFramework.Opsive.UltimateCharacterController.Scripts.Character.Abilities
That namespace doesn't exist. Opsive.UltimateCharacterController.Character.Abilities is likely the one that you are looking for.
 
Had to refactor it when i moved UCC into another folder. IDE was complaining about namespace not corresponding to directory.

1587086560831.png

Here in this image, there are the classes corresponding to the namespace. Ability is in them, but the IDE refuses to take it.

(Before the namespace refactor, i still needed to make a full import with the namespace as you said: Opsive.UltimateCharacterController.Character.Abilities at declaration. Using still didn't worked)

That started to happen when i moved UCC into another folder, to keep the project order


Edit: Maybe the animation i posted is clearer
 
I recently discovered that, if i import inside the namespace, then the problem fixes.


But it looks like a work around, especially because above i'm importing other classes outside the namespace without trouble
 
Okay, i just managed to solve the problem (Here is my question in Stackoverflow: https://stackoverflow.com/questions...only-works-inside-namespace/61262974#61262974)

The problem was, that i had another namespace called "Ability" where i saved all my custom abilities. And that was hiding the Ability class name, so the IDE had to make a full import to avoid naming clashes.

Simply by renaming my namespace "Ability" to another thing, the problem went away.

(I leave the info in this comment, if someone else in case someone else comes across this problem. It's a little hard to figure it out)
 
Top