A catapult trajectory

Dang, how old are you?

1 Like

too young to drive (speaking for myself)

2 Likes

Same here, I guess a lot of flow-lab users are young.

1 Like

Most of us are around 13+ years old.

2 Likes

Yea but uh anyways no more off topic this guy/girl needs help come on now

1 Like

Actually I dont know if I was 5 back then, was just assuming

1 Like

Okay lol. excellent game though. Perfect way to start your gaming journey.

I already helped them. The problem (should) be solved.

1 Like

Not at all, I’m still completely lost and have no clue how they make this fluent arcing motion. I’ve got this clunky one where it goes up and then down using ease’s

1 Like

if you emit an object affected by gravity upwards at an angle you get an arc. If you increase the forward angle of the object you get a longer arc. I’m assuming that none of the other objects in your game has gravity so adjust the Y gravity and the emit force to change the arc. That should give you a natural arc (I’ve never played Plants Vs Zombies so I don’t know what the arc is supposed to look like, so maybe this isn’t helpful). There are multiple equations that also show the arc of an object so maybe they could be helpful

Just emit it at an angle and make it figure out when it lands and summon a damage object.

1 Like

The issue is that, the object would keep going if it misses, and also do you know anyone with one of those equations :slight_smile:

1 Like

When the object reaches the Y value of the object that launched it have it detect if it hit anything. To predict where an object will land use you can use something like this.
(The distance that something travels) = ((Initial Velocity)*Cos(Angle)) *(Time it travels for). That gives you the X distance it will travel (Horizontal Motion). I’m not an expert at math/physics so I may have said something wrong, but that should be the equation

1 Like

Me being an idiot, has no idea how to make that in flowlab.

2 Likes

Using an expression that says

A(The Velocity)*Math.cos(B(Angle)) * C(Time it will travel for).
I think, haven’t used expressions for things like this yet

2 Likes

I’ve been trying to get this to work, but It would be nice if you had an example.

1 Like

I’ve run out of games so I can’t make an example (and I’m very busy with my own games/irl stuff). idk if this will help, but here’s an image that tries to explain it. (“g” stands for gravity)

If this doesn’t help a quick youtube search should be able to help.
(If you are using emit so you don’t know the X and Y velocity you can use an extractor to find it)

So now I’m more confused, I guess what I’m looking for is how I make this in flowlab, like where does the expression lead to?

1 Like

Ok, first I need to make sure I understand your question. Do you want to know where the projectile will land? or is it something else?

Well that’s the end goal, I just need to know what the expression goes into the make it arc. I think that will solve all the issues.

1 Like