Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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!

Product Version: UE 4.18
more ▼

asked May 21 '18 at 09:44 AM in Blueprint Scripting

avatar image

1 2 4

avatar image Nebula Games Inc May 21 '18 at 03:33 PM

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?

avatar image Thiénos May 21 '18 at 03:39 PM

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

avatar image Nebula Games Inc May 21 '18 at 03:41 PM

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

avatar image Nebula Games Inc May 21 '18 at 03:43 PM

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

avatar image Thiénos May 21 '18 at 03:55 PM

alt text

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

capture.png (339.6 kB)
avatar image Nebula Games Inc May 21 '18 at 04:01 PM

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)

avatar image Thiénos May 21 '18 at 04:11 PM

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

avatar image Nebula Games Inc May 21 '18 at 04:18 PM

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.

avatar image Thiénos May 21 '18 at 04:36 PM

I'm sorry but can you take a screenshot for show me...

avatar image Nebula Games Inc May 21 '18 at 05:16 PM

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.

alt text

movement.jpg (72.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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.

more ▼

answered May 21 '18 at 06:05 PM

avatar image

3.7k 18 23 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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

more ▼

answered May 22 '18 at 06:46 PM

avatar image

1 2 4

avatar image mightyenigma May 23 '18 at 07:10 PM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question