How do I scale a bullet for a mock 3D effect?

0 favourites
  • 7 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • Hi all,

    Sure this is very simple, but I've got a sudden case of brain-wrongs. It may have been answered before but struggling to find it on the forums. If a topic like this exists then a link to that would be great.

    I'm trying to make a fake 3D looking First Person shooting gallery game, in which you tap the screen to fire a projectile towards the players Touch. I've set it up like this so far and it works (sort of).

    So I have an instance variable on the Projectile object that scales it so it gets smaller as it flies off into the distance to give that 3D effect. However I want it to scale down realistically towards the point of Touch, rather than just off in in the Touch angle as it does now.

    I imagine that's done using Lerp to alter the time taken for the projectile to scale down based on its proximity to the target, but I always get a bit confused when the Lerp monster gets involved

  • Just to clarify, I simply want my bullet object to scale down to 0, according to the distance it travels to the touch input. As if it is going off into the distance.

    Been trying lots of things and looking at similar topics on the forums, tried using LiteTween plug-in, and not having any luck (couldn't find any working examples of how LiteTween could handle Scaling like this, most links are outdated and inaccessible).

    If anyone can help I'd really appreciate it

  • I've used two tween behaviours to adjust the size and position independently. It doesn't always look great out of context, but some combination of durations may work.

  • Thanks blackhornet

    That's really effective, but its not quite what I'm trying to achieve. I need the scale of the projectile to reduce in relation to the touch point.

    For example, if you touch near the bottom of the screen, the projectile would disappear into the distance much quicker than if you touched near the top.

    I'm sure I could use LiteTween to do this, but there needs to be some kind of event that tells the projectile what duration of time to scale down, relative to its proximity to the target. That's why I'm thinking there needs to be some kind of Lerp/Delta-Time event in place, but I'm crap with that stuff.

  • How about this?: ... .capx?dl=0

    It doesn't use any tweens, just checks the relative distance between the input and the spawn point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You nailed it mekonbekon that's exactly what I needed to do. Thank you so much

  • You're welcome

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