How do I do an aim zoom?

0 favourites
  • 10 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • we're making a SCP game and we have a player, when player aims somewhere , then how do we make a camera zoom? for example player aims somewhere and camera will zoom at that point.

    a thing like strikeforce heroes.

    is it possible?

    note: we're on c3, not on c2.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Could you clarify or provide an example of 'zooming' in this context?

    Generally speaking, zooming in/out is controlled with the 'set Layout Scale' action in System.

    If the idea is to move the camera towards the player's reticle, you could get the midpoint between the player and their reticle, then scroll the camera or ScrollTo object to that position.

    I can provide a better explanation with some more details

  • Hello, i'm the owner of the project, i was asking if i could make the camera ( the screen ) focus on the location of my mouse, like "scroll to"... Like from Heroes Strike Force 2D Game, where you can aim anywhere with your mouse and the gun pointing on it, woth ofc some restrictions so the camera won't go too far from the character! If you played the game before, it will be make more sense and more clear! Here's my discord if wanna talk : the.dclass

    See ya and thanks for getting interested

  • To constrain an (invisible helper scroll-to) object position to a radius around an origin point (player) based on the mouse position, first set the object position to the player, then use move at angle to move it towards the mouse position (angle(player.x,player.y,mouse.x,mouse.y)). The distance will be the distance to the mouse or the max distance, whichever is smaller, by using the min() expression.

  • Ok, so looking at the gameplay of the video, I think a simple way to do this might be to do the following...

    Make a crosshair sprite and use "every tick" to set the crosshair at mouse.x and mouse.y.

    Then, add the "scroll-to" behavior to both the player and the crosshair.

    What "scroll-to" does is attempt to center the viewpoint on whatever object it has on it. If you add "scroll-to" to multiple objects, it does a quick version of what oosyrag has described. However, using Scroll To like this means that you can't do little cutscenes where the camera focuses on another object.

    Although oosyrag's version is a bit more complicated, you can do more things with it once you know how.

  • i think i found it and also thank you,

    my idea is, when mouse right click is down, the camera zooms on the crosshair, but a little question, how should i do a zoom on an object? (the crosshair)

  • Well, essentially you have everything you need. Basically, when you are not right clicking, it does the zoom between two objects. When you are right clicking, it only zooms to the crosshair.

    If you're doing the "scroll to" method, you can just set the behavior disabled on the player while you are right clicking and enabled when you aren't.

  • it just makes the camera scroll to the crosshair, but it doesn't zoom u know

  • Oh, did you try Layout Scale like peter568 mentioned up above?

  • Oh, did you try Layout Scale like peter568 mentioned up above?

    How should i do layout scale on an object?

    Like mouse

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)