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

Get help using Construct 2

Post » Fri Jul 21, 2017 12:10 pm

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).
https://www.dropbox.com/s/l63db4naynyle3w/Throw%20Test.capx?dl=0

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
B
7
S
2
Posts: 14
Reputation: 577

Post » Mon Jul 24, 2017 3:25 pm

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
B
7
S
2
Posts: 14
Reputation: 577

Post » Mon Jul 24, 2017 4:45 pm

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.
http://www.blackhornettechnologies.com/Construct2Stuff/Tween3D.capx
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Tue Jul 25, 2017 7:26 pm

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.
B
7
S
2
Posts: 14
Reputation: 577

Post » Tue Jul 25, 2017 7:46 pm

How about this?:

https://www.dropbox.com/s/hrr7lggb5b3sh ... .capx?dl=0

It doesn't use any tweens, just checks the relative distance between the input and the spawn point.
B
20
S
8
G
3
Posts: 458
Reputation: 4,055

Post » Tue Jul 25, 2017 8:24 pm

You nailed it @mekonbekon that's exactly what I needed to do. Thank you so much
B
7
S
2
Posts: 14
Reputation: 577

Post » Tue Jul 25, 2017 8:49 pm

You're welcome :)
B
20
S
8
G
3
Posts: 458
Reputation: 4,055


Return to How do I....?

Who is online

Users browsing this forum: PROxMTswatTR and 15 guests