x

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"

Movement system where actor follows mouse

I'd like to have a movement system for my mobile game where the player can touch anywhere on the screen and have the actor mimic the movements. A perfect example of what I want is here.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 11 '17 at 02:35 AM in Blueprint Scripting

avatar image

r4rev2
68 14 17 18

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first

This kind of game requires tricky setup, not only for movement.

You can do it by converting screen coordinates to world coordinates in some specific distance from camera. Or you can place box primitive in that distance and use PlyaerContoller -> GetTraceUnderFinger. This will return world location of touch on that box, and you can use it in SetLocation for your character.

more ▼

answered Jun 11 '17 at 05:23 AM

avatar image

redbox
4.2k 80 17 103

avatar image r4rev2 Jun 11 '17 at 05:51 PM

Can you elaborate? I've never done anything with touch controls before. I suppose I could just do something where you click on the screen and move the mouse since touch and mouse clicks and movements are the same.

avatar image redbox Jun 11 '17 at 06:52 PM

Mouse clicks and touch is not the same. But you can simulate touch by mouse clicks if its set in project settings - input. + getplayercontroller -> show mouse cursor.

Anyway, you should start from tracing

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Game/Player/GetHitResultUnderFingerbyChannel/index.html

avatar image r4rev2 Jun 17 '17 at 11:05 AM

Is there anyway you could show me more or possibly find a tutorial? Sorry I'm new to this.

avatar image redbox Jun 11 '17 at 06:50 PM

Mouse clicks and touch is not the same. But you can simulate touch by mouse clicks if its set in project settings - input. + getplayercontroller -> show mouse cursor.

Anyway, you should start from tracing

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Game/Player/GetHitResultUnderFingerbyChannel/index.html

(comments are locked)
10|2000 characters needed characters left
Be the first one to answer this question
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