playMaker

Author Topic: Camera Pinch Zoom  (Read 3797 times)

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Camera Pinch Zoom
« on: March 26, 2015, 10:01:12 AM »
Camera Pinch Zoom (Touch zoom for main camera)

Needed a quick simple camera pinch zoom.

Usage:
Set main camera to true if you want to use the current main camera. If false, set camera gamobject and when action is active it will set gameobject camera to main camera (same as 'set main camera' action).
 
Set pinch zoom speed for ortho and persp. Both are separated for full control - depending on what the current main camera is.

Set the FOV(persp. camera)/size (ortho. camera) clamp so the min and max you will allow the user to zoom.

Force action quit bool (Disable Action). If you need this action to finish and send an event set the bool to true.

Advance action included
Usage:
1. Same principle as above except that when pinch zoom is active will set active bool.
2. Can send an event when Pinch Zoom active = true without exiting action
3. Can set the amount of fingers (min 2) needed to touch/pinch zoom. hint: 2 is good and 3 is ok.
4. Active (x) finger count means when true that 2 fingers (because store finger id = 2) have to touch the screen at the same time for action to activate. This avoids conflict with other touch actions.

Note: The action is everyframe by default. Same method as the other device touch actions.

Update: all actions + updates are on ecosystem or https://snipt.net/dudebxl/
Small update to 'PZ Advance action" - got rid of warning info - update in above link


Hope it helps someone.
« Last Edit: May 31, 2015, 01:14:33 PM by dudebxl »

Krillan87

  • Full Member
  • ***
  • Posts: 112
    • View Profile
Re: Camera Pinch Zoom
« Reply #1 on: February 28, 2018, 06:07:27 AM »
Camera Pinch Zoom (Touch zoom for main camera)

Needed a quick simple camera pinch zoom.

Usage:
Set main camera to true if you want to use the current main camera. If false, set camera gamobject and when action is active it will set gameobject camera to main camera (same as 'set main camera' action).
 
Set pinch zoom speed for ortho and persp. Both are separated for full control - depending on what the current main camera is.

Set the FOV(persp. camera)/size (ortho. camera) clamp so the min and max you will allow the user to zoom.

Force action quit bool (Disable Action). If you need this action to finish and send an event set the bool to true.

Advance action included
Usage:
1. Same principle as above except that when pinch zoom is active will set active bool.
2. Can send an event when Pinch Zoom active = true without exiting action
3. Can set the amount of fingers (min 2) needed to touch/pinch zoom. hint: 2 is good and 3 is ok.
4. Active (x) finger count means when true that 2 fingers (because store finger id = 2) have to touch the screen at the same time for action to activate. This avoids conflict with other touch actions.

Note: The action is everyframe by default. Same method as the other device touch actions.

Update: all actions + updates are on ecosystem or https://snipt.net/dudebxl/
Small update to 'PZ Advance action" - got rid of warning info - update in above link


Hope it helps someone.

Hello!

I hope this is the correct forumpost to ask this question. I downloaded your action and everything seems to be working except my device is not zooming.

I can see in the inspector that the size of the orthographic camera is changing but nothing happens in the game-tab/on my device.

Any clue what could be wrong?