Casting/pawn sensing

Hello guys so yet again i have a problem …I am trying to tell an actor the status of on see pawn . I tried using cast to and then getting the pawnsensing data but it does not seem to work

I have a cube that senses my player as it passes by…
I want to use this data to trigger other events such as doors opening etc .
I know i need to cast to but i am not sure how this would look as simply casting to the sensing pawn does not seem to work

Hope that makes sense

The cube has an AI. So it can see the player and fire functions on that event. If you want to use such data “globally” so other actors or blueprints can read it i suggest you make a custom “Game mode” (MyGameMode for example), set that as your default game mode and you can use it as a library of informations. SO in “myGameMode” make a new boolean variable called “CubeHasSeenPlayer”. Default is false. Then in the game mode make 2 new functions “GetCubeHasSeenPlayer” where you just add a return node that returns your “CubeHasSeenPlayer” boolean variable. In “SetCubeHasSeenPlayer” you set the value of this variable.

Now in your Seeing cube you have the function that triggers when it sensed the pawn. Here you cast to MyGameMode (“GetGameMode” as a referece) and call the “SetCubeHasSeenPlayer” to true.

Now in your level blueprint (Or pawn if you like that better!) you use the “onTick” function there you cast to myGameMode again and use a branch on “getCubeHasSeenPlayer” and simply use a printString to print something like “OMG the cube saw me”. Test that.

If the cube never moves you could also use an overlap trigger, so when your player pawn overlaps it you set the boolean or fire a function. You can use a box or sphere collission to trigger events once the player overlaps them, such triggers can stay invisible.

Franktech helping out as usual …Hello again .I have been telling myself to keep going and not quit but i really am struggling to grasp the basics .If i am honest i should give up but just cant bring myself to quit . I have just tried the solution offerd by fronzeleekburm And got very confused very quickly . (MY FAULT NOT HIS) i have used trace in the past when i created this tree chopping mechanic https://www.youtube.com/watch?v=szVOyYi5jfc&t=48s But have since forgotten all i learned during that process .And i would love to use overlap but no matter what i tried i simply could not get things to trigger without my ship exploding .:stuck_out_tongue: My solution of using on see pawn seemed to be working great …Lol but since i can only seem to trigger locally is a bit of a pain …

Ok so i am trying to cast to main game mode but it is asking for object …wtf what bloody object i have not dealt with anything called an object since my days with gml …

Hi franktech.I am no longer working on that project since it had a huge scope and i would never have gotten close to finishing it . Hence my move to what i thought was a much easier project.Also i am not spawning the track i am laying it down before hand .I was planning on destroying geometry behind the player as he/she moves forward and limiting the draw distance .so that the amount of geometry on screen would always be manageable . i will look into the get distance to node .It sounds like a relatively simple solution .At least it does today whilst my head is clear . Just to clarify
My current project is not an endless runner but has/will have finite tracks . Which are not procedural but rather placed by hand . (Mainly because the quirks of my players control )

Thanks again franktech