I’m not even entirely sure if this is the case but I think my line trace is attempting to access a variable or it is causing something for the variable to be accessed?
My aim is for the line trace simply hit an object, then for some relevant text to appear on screen for said object.
This then triggers an event within the game mode, which in turn triggers another event to occur within the user interface to change the PressKey variable from “test” to display “This works” on my user interface.
I’ve used settext (text) to alter the “Press Key” variable, which is some text on the user interface.
However when I go to test the game, the text does not change whatsoever, and instead I receive accessed none errors.
The reason I think it is because of the line trace, is that when I trigger the same piece of code by something anything other than the line trace (such as a simple F key press) it works just fine.
Thanks for the response! I haven’t tried this yet but I put the print string there just to confirm that the line trace was identifying the object, I think the issue was occurring before I put the print string there.
Do you think the IsValid is causing the issue though?
I’ve just tried removing the print string and unfortunately the error still persists! Just to preface, this error only occurs when the line trace hits the object and begins executing the settext (text) code
Indeed! I’m just trying to understand how the line trace would be interfering with the “pressKey” variable. Since it is that variable that is coming up as the none accessed error, even though the variable has a value, which is the text.
I feel like the line trace is trying to access the “pressKey” variable as a value that isn’t what it is? Just a guess though
You could post the actual error message - not only does it tell it what is wrong, precisely, but is also hyperlinked and, once clicked, will take you to the offending node. There is not enough script shown to determine what is going on.
Sorry I really haven’t explained this very well I’m really a rookie in this, it’s my bad for doing such a bad job with this question!
The variable isn’t created out of nowhere however, it is a piece of text on the user interface that has been checked as “is variable” and given the name pressKey
Furthermore the script works exactly as intended when this whole series of events is triggered by something simple like a key press. But when it is triggered by the line trace, it comes up with this error