0
\$\begingroup\$

I've recently created a shuffle-type puzzle game for mobile (with Unreal Engine 4), where you, obviously, solve these puzzles.

Since I didn't know how to do this puzzle mechanic in UE4, I went to UE4 - Slide Puzzle Pt.1 by Nicholas Thompson.


The problem:

Somewhat halfway through the tutorial, I stumbled on a very important issue: the block / tile of the puzzle wasn't moving when clicked on.


What I did:

I then rewatched the whole tutorial again, and didn't find anything wrong. I tried placing Print Strings on Bind Event to OnClicked, it worked, then I placed it on Mesh Clicked, and it didn't.


Cause of problem:

After I debugged, I found out that Move To was not called because for some reason, Is Valid...didn't work? (This is found at the end of the chain in the Mesh Clicked custom event.)


The code for the Event Graph is pasted here.

I have been trying to fix this problem for days, help would be very much appreciated! Thank you!

\$\endgroup\$
10
  • \$\begingroup\$ I'm not seeing anywhere where you're setting the MoveToTarget. If it's not being set, Unreal will see it as a nullptr and it will never be valid. \$\endgroup\$
    – Stephen
    Feb 10 at 9:20
  • \$\begingroup\$ Hi, sorry for the late reply Stephen. While making the function, Get Move To, I created the Move To Target variable set to Primitive Component (Actor), as the tutor set it to be. \$\endgroup\$
    – Kupachu
    Feb 10 at 11:49
  • \$\begingroup\$ Time for a print string then. Before trying to call the IsValid function, get the Display Name of the Move To Target. I suspect it's not being set properly inside that function. \$\endgroup\$
    – Stephen
    Feb 10 at 12:36
  • \$\begingroup\$ Um...I don't get what you mean by 'get the Display Name' of the var, sorry. \$\endgroup\$
    – Kupachu
    Feb 10 at 12:48
  • \$\begingroup\$ If you pull off the pin from the Move To Target and type in Name, one of the options will be to Get Display Name which is a text (or string). Plug the result of that into a Print String node and see what you get out of it when running your program. \$\endgroup\$
    – Stephen
    Feb 10 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.