Hi there,
I'm doing a tutorial series to learn how to make an on-rails shooter to protoype some ideas. The tutorial is a few years old, but I'm on Unity 6000.1.12f1.
Tutorial (Stuck on Part 2): https://www.youtube.com/watch?v=-sbBkRrVQZg&list=PLnJJ5frTPwROHmPx61qjFk9BBYczWt-Nu&index=3
I'm stuck on the second video because I can't seem to get my ship to aim and I've messed around my code for answers so much that for whatever reason I can no longer move my ship around like I previously could either. I'm looking at my console for clues, but the only thing I see is the following error:
UnityEngine.Debug:LogError (object,UnityEngine.Object)
KBCore.Refs.SceneRefAttributeValidator:ValidateRef (KBCore.Refs.SceneRefAttribute,UnityEngine.Component,System.Reflection.FieldInfo,object) (at ./Library/PackageCache/com.kylewbanks.scenerefattribute@8d3a0ee42158/SceneRefAttributeValidator.cs:442)
KBCore.Refs.SceneRefAttributeValidator:Validate (UnityEngine.Component,System.Collections.Generic.IList`1<KBCore.Refs.ReflectionUtil/AttributedField`1<KBCore.Refs.SceneRefAttribute>>,bool) (at ./Library/PackageCache/com.kylewbanks.scenerefattribute@8d3a0ee42158/SceneRefAttributeValidator.cs:186)
KBCore.Refs.SceneRefAttributeValidator:Validate (UnityEngine.Component,bool) (at ./Library/PackageCache/com.kylewbanks.scenerefattribute@8d3a0ee42158/SceneRefAttributeValidator.cs:120)
KBCore.Refs.SceneRefAttributeValidator:ValidateRefs (UnityEngine.Component,bool) (at ./Library/PackageCache/com.kylewbanks.scenerefattribute@8d3a0ee42158/SceneRefAttributeValidator.cs:105)
RailShooter.InputReader:OnValidate () (at Assets/Settings/InputReader.cs:35)*```
Double clicking this error doesn't take me to my InputReader Script, but rather a random script in a document called SceneRefAttributeEditor.cs to the line saying: ```Debug.LogError($"{c.GetType().Name} missing required {elementType?.Name + (isCollection ? "[]" : "")} ref '{field.Name}'", c.gameObject);```
I haven't touched this as I don't know what it's talking about.
I've attached the InputReader and WeaponSystem scripts I'm working with. I was experimenting using CoPilot for the first time tonight to fix up any errors or fix any code I copied from the tutorial that for some reason didn't work, so somethings may be wrong though I tried to copy and correct it as best as I could. If someone could help me get a handle on this, I'd greatly appreciate it as it's holding me up a lot and I've had this problem for a while. Also, please explain this clearly if you figure out what is wrong, I am an artist and intermediate coder who doesn't code often, not an advanced programmer.
Note: That the KB Core stuff is based on some library imported in the first video. The above link is a playlist link, so you can navigate to that if you need to for info.
Shooting straight ahead is boring! Let the Player Aim and Shoot while moving along the rail in this second episode of our Rail Shooter Game Development Series. We're going to use some smoke and mirrors, invisible to the player, to create a unique and very FUN aiming system that looks good and feels good.
🔔 Subscribe for more Unity Tutorial...