Seeing the future with physic

Hello everyone,
It's probably something that was answered already but I'm bad at explaining it!

I want to do a preview for some rock throw or whatever, to show the path the object is gonna travel before to it the ground. With mono that was done by duplicating the necessary elements into a new scene and being sure they were updated, and then simulate the future. My nose is telling me that Unity probably took a similar direction with world here, so could someone explain to me or give some ressources to do that kind of stuff ?

I kinda hope it will be cleaner that the mono version though ! Maybe even naturally optimised to stream the space you want to check.

Edit : looks like my best shot is in the pool sample for now, but I'm afraid to not correctly understand it. So I'll stay here !

Edit 2 : I just realized something... because all I want is to check the positions of a simply throw object, in a static world (at least it's the only object moving in the simulation)... Shouldn't I simply compute the possible positions myself and then ask for each segment if there is a colision? Wouldn't be that even more efficient ?

Thanks a lot !

As you already figured out yourself, you should take a look at the Pool demo scene in the PhysicsSamples project (see "Immediate Mode / Pool").
It performs a prediction simulation to display the trajectory that the pool balls will take if a certain stroke is made.

I think that fits your use case quite well.

Let me know if you have questions about it.

Thanks for the confirmation !
In fact the prediction approach is quick and really precise.
Maybe I could have some questions on the pool samples, but that's no longer relevant !
I'll create a thread about physic questions for the Dev Blitz Day.

1 Like

Sounds good. Don’t hesitate to reach out again.