SetActorLocation only functioning after recompile

Hi everyone, so the problem I am facing right now that I have this one blueprint, that when I open the project, functions normally in the blueprint editor (when checking breakpoints and all that). So I am sure that SetActorLocation is actually triggered with a new location. However in the actual world, the actor does not move at all or show any signs of moving, It will only start working if I first re-compile my blueprint, I have to do this everytime I open the project! (and it also doesnt seem to work in a standalone win64 export)
All other blueprints I have involving actor movement work right away when I open my projects so I am kind of at a loss: Things I have tried so far:

  • Change the logic in the blueprint (from setactorlocation to set relative transform), nothing.
  • Make a new blueprint alltogether for the same task, nothing.
  • Build and export the project and hope it works there, nope.

Since I have tried it in different blueprints and different methods there still might be something in my blueprint that is causing this issue, but I am having a hard time wrapping my head around what would cause one blueprint not to work unless it is recompiled every time I open up the project.

some screenshots of the blueprint:

Don’t think you will be able to find much in this screenshot, the blueprint behaves as it should, it is just that the actor in the editor is not reacting to the Setactorlocation unless I recompile.

Screenshots pls.

and what about construction script,do you have one?

It is strange to have to keep recompiling the blueprint every time. Does it show that it needs to be recompiled every time as well? Or does it have the compiled green checkmark but you have to compile it before playing every time anyway?

If it shows it (The orange question mark on the compile button) every time you go back in the blueprint, then you could try unhooking some nodes a few at a time to see when it stops constantly asking to be recompiled. Then you would at least know which nodes are causing the compile error.

I know the only “symptom” you have stated is that setting location doesn’t work, but you don’t know for sure if that is the node that is causing the compile problem. Fixing one may fix the other.

Hi, it appears as though it is compiled, so with green check mark, when i open the project, so I edit a node, and put it back, then recompile, then it works.
About which node is causing this problem (if this is the problem at all) I do not have a clue, the setlocation node not having any effect was just the first thing I noticed when checking why my actor was not moving as they should.

Since it is an actor component blueprint, there is no construction script. However I would like to add that I have never used construction scripts yet, are they integral to solving issues like this? So should I perhaps try to make it work in an actor blueprint?

Well…now it’s just being mean. :stuck_out_tongue:

The only thing I can think of to do would be to keep unhooking nodes a few at a time and keep closing/opening the project to see if the error is there. If it is always going to show green arrow regardless, you would have to actually play through each time to the part that it bugs as well. Eventually, you could at least find out which part of the code is causing the trouble.

I realize if we are talking about an absolutely huge blueprint, this might not be a viable option. I’m stumped on what else to do though. The code in your screenshot doesn’t seem problematic. It is just subtracting one vector from another and plugging it into the new location. The only node that might be of issue is the get attach parent actor, but I’m assuming you would have already checked a long time ago if there wasn’t parent attach in world outliner (what I believe that node is used for? But, I don’t use it that often).

Add print strings on each function.

Func Update Position: Compare new position against past before executing. I’d also drop a print string on fail.

Okay so the cause of this turned out to be my own stupidity after all, the reason why we could not find any issues in this blueprint was because it was working fine. However I found that there was an obsolete blueprint that was still in the scene both trying to set the actor location every frame causing the interference.
Why this would stop happening after recompiling might have to do with the order Unreal engine executes each blueprint, what I’m thinking is before recompiling, the obsolete blueprint sets the location last, and after recompiling this is flipped and the new blueprint sets the location last each time.

Ofcourse the solution is simply removing the obsolete blueprint since its not needed anymore.