can you guys tell me what this means and what the problem is and maybe how to fix it? I’m just genuinely confused.
Accessed None Trying to read property "Current Weapon" Blueprint FPSCharacter Function: Execute Ubergraph FPS Character Graph: EventGraph Node: Branch
moving on up
your variable isn’t getting set.
thats all that can be said as you haven’t provided any context.
moving this up
This. How do you set that variable. How do you assign it value? You can also click the errors in the log and it will take you precisely where it triggers.
It does. The problem is I don’t know how to fix it. Moreover, I don’t understand why it doesn’t set when everything’s connected.
You wouldn’t be seeing this error if it was.
Moreover, I don’t understand why it doesn’t set when everything’s connected.
So… could you show/explain how/where it’s done then? What you’re showing currently does not cover the root of the issue.
I wasn’t talking about the variable being set, I was talking about it clicking and showing you where it is. this is gonna take a while.
in this Screenshot im getting the rotation of the muzzle bone and im setting the variable for the rotator. this is a function.
I might as well just send you the errors so you can see exactly where they come from.
Thats where the functions being called.
I got two branches here that are accessing nothing from CurrentWeapon. I don’t get this.
I got a character here I want to equip with a weapon, but its telling me the character reference can’t be accessed in the last three nodes.
You’re still not showing how Current Weapon variable is Set. You say it’s being done. Could you please demonstrate it? It’s not in the screenshots.
I got two branches here that are accessing nothing from CurrentWeapon.
According to the errors messages, there is no Current Weapon. You’ve created this variable, right? How did you assign it value?
I’m out right now so I can’t show you it, but I do believe I set current weapon in another part of the event graph for the FPSCharacter. I’ll send screenshots to you when I get back. I don’t get the rotator problem, maybe I need a default value? I’ll show you when I get back.
But I did make current weapon in my Blueprint. It’s on the side, I’ll send you a ss on both variable sets for fpscharacter and bpweaponbase
all my variables here, current weapon is a BPWeaponBase object reference. I fixed the “variable” variables and now every single error is an object reference. what in gods name do I do here?
apparently it doesn’t let me put more than one ss at a time now?!? Thank you unreal because new people definitely shouldn’t have that ability the world would go mad
Creating a variable does nothing. It’s null. You need to point it at an object. It’s like creating a string var but forgetting to type the actual text but worse.
How are the weapon actors created / spawned, how does the player know which weapon is the current weapon? As at the very beginning of the thread:
How do you Set the variable? You need to populate it, assign value.
Think of the reference variable as of an arrow that is pointing at a specfic address in computer memory. At the moment it’s not pointing and we don’t even know if there’s anything to point at.
How does the engine know which weapon is the Current one if there are 10?
its a BPWeaponBase Variable. I don’t understand HOW to set it. the default value doesn’t work, despite what unreal engines documentation say, as in the eyedropper, the magnifying glass (which never worked anyways) and the normal text box are all locked. What do I even do. you’re telling me it needs to have a value: I understand that. HOW do I do it is the question that I need you to answer. in your games, how do you call these blueprints? nothing here is working and its frustrating me because I can’t learn anything when it just continuously doesn’t work across the board because of one error that is apparently so simple to fix.
Welcome to object oriented programming.
there are a lot of ways to access a blueprint but it totally depends on ur situation, whether it’s overlap or raycast or if they are in a completely different level.
so if you want exact solution u need to show us where the actor is created which actor wants to access it and how.
Disclaimer: pseudo-script follows; don’t use as is or else!:
- we have a base class and 2 children
- the player can only have 2 guns and they start with 2
- the first one is the current gun
- 1 toggles between them
- this needs attachment, hiding unhiding and whatnot; more logic for picking up / dropping actors
And if the player starts with 2 empty WeaponSlots (as you call it), how do those slots get populated with the correct weapon reference - here we circle back to the error messages: how do you SET Current Weapon. Because it’s clearly not set.
And Get / Set is this:
You can see it used with Gun / Weapon vars in the 1st pic.
There are more ways to instantiate those weapons but you’d need to detail the desirable behaviour.