# Help with making trajectory line?

So I am making an angry birds type game and I am wanting to make it so while you are aiming the “bird” it will show a line of trajectory to help the player aim. I am wondering how to do this below is my bp that involves the shooting of the “bird”.

At the heart of the problem, you’re basically going to have to simulate the object moving through the air each time the player adjusts the aim, then draw something to represent each step (e.g. every 100 units that the object travels or every simulated 0.2 seconds, depending whether your want the trajectory dots to be a fixed distance apart, or not).

If you’re using the engine’s physics to move the projectile, that might be tricky. (I think) you’re going to have to re-create the calculation that the physics engine would use to move the projectile and simulate it yourself. Personally, I’d be writing my own movement/collision logic and simulating that (so I knew that they’d match up exactly), but I guess that depends on what else you’re doing in your game. If you’re keeping the physics of the projectile simple, it shouldn’t be too difficult to work out what it’s doing and copy it though.

Woah thats a lot! lol I am still pretty new to blueprints how would I go about the simulation part of it?

At a very high level, say you had a movement/update function that took in a delta time and moved your object a small amount each frame. Over the course of a couple of real seconds, the object would move along it’s path.

Well, you’d want to do a loop and call that multiple times, pumping out the results of each new location and using that to plot a path. If you’re using the engine’s physics, you’ll need to find out what the physics would do and create a function that does the calculation so you can re-create it.

Alternatively, if you’re path is really basic (the object flies straight or in a simple arc) you may just be able to work out the trajectory in one shot, but I think that’s unlikely to be what you want. But it depends what you’re trying to achieve really.

Good luck.