Set up the motion of an image

Hello everyone,

I am just starting to use unreal engine which is very convenient.

Only I block on one point. The goal of my game is to catch food that falls in columns (basic but I train). But I can not put in place the movement of the image that has to catch food. I would like the image to move between columns with directional arrows from left to right.

Can not find the solution on the internet so I call you.

Thank you for help!

There is a problem on the target because my target is not a pawn and i don’t know how fix that.

Is this image like your “player” character? It is just a 2D sprite or something? Like are you having issues receiving “player/controller” input and having it move something in the game level?

Mon jeu est en 2d . Et le problème que j’ai est que je n’arrive pas à mettre cette image en tant que personne. Je ne peux donc pas utiliser les évènements mit en place par unreal. À chaque fois il y a un message d’erreur sur la target de l’événement input axis mouvements. J’ai créé un blueprint qui n’est pas “pawn” puis j’y ai inséré mon image. Le blueprint est un acteur simple

I don’t speak French, sorry…Google did a decent job though for others looking to help:

My game is in 2d. And the problem I have is that I can not put this picture as a person. So I can not use events set up by unreal. Each time there is an error message on the target of the event input axis movements. I created a blueprint that is not “pawn” and then I inserted my image. The blueprint is a simple actor

So take some screen shots of your set-up I don’t see why you can’t just add a widget component to your player character BP or any blueprint you want and use casting to get references for your actor BP

For the option 1 there is no other think to do because that doesn’t work. There is no error but my picture is not moving so i don’t uderstand

I’m sorry but can you take a screenshot for show me…

You could do one of two things…

  1. Re-parent the class to be a pawn so you can use this built in functionality (Easy)
  2. Create your own movement logic using nodes like “add actor world offset” (Hard)

Did you re-parent to a pawn class? Because that isn’t the only thing you need to fix I just said it was the easiest because you could then use the “movement input” nodes. You still need to properly set up those movement input nodes. Use your left/right axis mapping and the pawn “right” vector as the “world direction” vector.for that node and you should be fine.

Something like that. This is in the player controller, you can do it in the player pawn BP but the nodes are slightly different I believe. Search for the movement stuff you should find it.

Question: Are the fruit images spawned in the game world, or are they displayed on the viewport/HUD as UMG widgets?
If they are pure UMG, then you will have to approach the game differently than any Unreal tutorial I know of will tell you to do.

If you are spawning them in the game world or they are placed in the Level, then yes you will need a Pawn to control the image that is representing the player.

If you want smooth movement so the player can be positioned between columns, then Nebula Games’ approach should work for you.

If you want the pawn to snap onto the columns instantly, not allowing a position that is not perfectly lined up with a column, then you will want to Set Actor Location instead of Add Movement Input.

Thanks for the comments that very help me! It’s works now.

OH good. Please mark Accepted on the answer that helped you the most. (it will make a green checkmark icon).