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"

How can I add Pinch to zoom with touch?

I know there must be a way this is possible but It's too hard to test this on mobile because I have to build it every time. What is the best way I could impliment this?

I already was able to get a camera to move around with a top down view of my level I just couldn't get zooming in and out to work correctly. Get Input Touch State should be all I would need to impliment gestures like this but I still do not know how the math would work and the event graph quickly fills up with nodes when im attempting this. I thought I heard about gesture support coming to blueprints soon so is that something I should wait for?

Any help would be appreciated.

Product Version: Not Selected
Tags:
more ▼

asked May 12 '14 at 03:57 AM in Blueprint Scripting

avatar image

mikesdav
51 4 5 9

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

3 answers: sort voted first

I did all the math myself using examples from implimentations in actual code. It's fast and has almost no performance hit even when using all the math in blueprints. Im not posting images

more ▼

answered Aug 18 '14 at 11:53 PM

avatar image

mikesdav
51 4 5 9

avatar image Nick Jackson Apr 23 '16 at 05:23 AM

Not very helpful. Why accept your own answer without actually providing one?

avatar image mikesdav Apr 23 '16 at 09:25 AM

This is two years old I really don't know why i didn't post any images but I no longer have the blueprint. Its really simple so I really just suggest people to try it for themselves.

I have not touched unreal in a while though, they probably added support for this already so this is probably irrelevant.

avatar image aphares Jul 22 '16 at 12:59 AM

So helpful, thank you

avatar image mlapasa Nov 27 '17 at 09:09 PM

My reputation is not high enough, but if I could, I would downvote this answer even more

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

Hi, I am learning about setting up touch events myself so I ran into your question. First I am including a screenshot of a simple blueprint setup for zoom in and zoom out using mouse wheel, this is a screenshot from a character blueprint's graph. As for the pinch actions, on each touch event you would need to check if there are 2 locations(2 fingers) touched at same time, if so then get both locations and calculate distance and put it into a new variable "Distance1". Then on next touch event (2 fingers) create "Distance2" variable and compare it to "Distance1". If is bigger or smaller would determine whether we're zooming in or out. You could divide the distances to get a multiplier for setting the zoom , which is the TargetArmLength of the camera (its attached to camera). alt text

screenshot213.jpg (294.3 kB)
more ▼

answered Jun 01 '14 at 09:50 PM

avatar image

Jurif
632 26 15 45

avatar image AgentGhost Jul 23 '14 at 01:47 PM

Jurif Can u specify some doubts because i'm a newbie on blueprint Can you specify what i"m marked in the attchment.? Is it variabiles? What type is it? Can you specify little detailed Sorry for my bad english Thanks in advance alt text

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

Hi, I am including more screenshots, alt text Camera Boom is a Spring Arm Component , if you go to the components BP menu (screenshot1), you can see the setup, as you can see TopDownCameraComponent is a attached to Camera Boom, which is the red line you see on the right side. This is basically the way you would setup a blueprint for a character, in this case it is a catapult. If you change the settings for Camera Boom --> Transform (location, rotation,scale), you are changing the distance from the catapult to the camera. Look at the Target Arm Length setting, this is what we are changing in the blueprint to simply zoom out or in if you increase or decrease that number. alt text The way you would get the Camera Boom (Spring Arm Component) on the EventGraph is shown on screenshot 2, you just select the component from the variables list on the left side and drag it into the graph.

Then you would click and drag on the Camera Boom node and once you release it gives you a list of functions and variables that are somehow related to Camera Boom component, look under Variables -->Camera--> there you can find the Target Arm Length variables.

If you'd open examples with characters, you would see same setup for camera in the bluprint, also this series of video tutorials includes a video, I don't remember which one it is, where he created this same system with Camera Boom Spring Arm Component and attaches camera to it. https://www.youtube.com/watch?v=GWbd0Wowwnk

screenshot259.jpg (396.2 kB)
screenshot260.jpg (482.7 kB)
more ▼

answered Jul 23 '14 at 03:36 PM

avatar image

Jurif
632 26 15 45

avatar image AgentGhost Jul 24 '14 at 05:59 AM

Thanks Jurif. Just One more questions, How to make character movement using pinch like when I pinch out it should go forward and pinch in it should come back. Like in this Video ( https://www.youtube.com/watch?v=OjLh1EjVTwY ) this was made in Unity. Thanks again

avatar image Jurif Jul 24 '14 at 11:01 PM

Well I'm sure there are examples on how to do that out there, but the basic idea would be same , just that you want to affect the movement of character instead of camera distance. I'm not promising anything, but if I'll have some time in next few days I will make a blueprint example for that and post the answer with screenshots.

avatar image AgentGhost Jul 25 '14 at 06:50 AM

Thanks Jurif

(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