2
votes

I just downloaded UFPS asset in unity but after importing i get some errors. I cant find a way online on how to fix that.

Unity Version: 2018

Errors:

Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS1540: Cannot access protected member UnityEngine.Texture.Texture()' via a qualifier of typeUnityEngine.Texture'. The qualifier must be of type `vp_LocalPlayer' or derived from it

:

Assets/UFPS/Base/Scripts/Gameplay/Player/Local/vp_LocalPlayer.cs(62,46): error CS0122: `UnityEngine.Texture.Texture()' is inaccessible due to its protection level

Line with error:

static Texture m_InvisibleTexture = new Texture();
2
Have you tried posting a comment on that asset to see if they are aware of the issue? Can you also post the version of Unity you are using? - AresCaelum
One last thing, did you also try running the updater that comes with that asset? - AresCaelum
The updater didn't work but it seems that the project was not updated to work with unity 2018 beta so I had to use unity 2017. - user9211718
So it works with 2017? Also, what is that texture being used for? if you know I can probably give you a work around for it... - AresCaelum

2 Answers

0
votes

static Texture m_InvisibleTexture = new Texture(); // ERROR static Texture m_InvisibleTexture = null; // NO ERROR

0
votes

Replace your line with

private static Texture m_InvisibleTexture = new Texture2D(2, 2);

You'll also run into this error:

Assets/UFPS/Base/Scripts/Gameplay/Editor/vp_FootstepManagerEditor.cs(228,25): error CS0143: The class `UnityEngine.AudioClip' has no constructors defined

Here's a link to a fix and more about the problems you'll encounter:

http://www.opsive.com/assets/UFPS/forum/index.php?p=/discussion/3979/2018-compatibility