playMaker

Author Topic: Reflective Trajectory Prediction?  (Read 693 times)

patheticorganic

  • Playmaker Newbie
  • *
  • Posts: 11
Reflective Trajectory Prediction?
« on: May 10, 2021, 12:38:48 PM »
I have a character that shoots out a projectile that bounces off walls. How could I go about predicting its trajectory, including its bounce, off walls, something Angry Birds/Billiards esque. It moves via adding force to it when I spawn it into the scene, and on colliding with the wall it sends out a collision event stopping all of its momentum after a few seconds.

I've searched for trajectory-based actions on the Ecosystem and I found one -but frankly I am not that well versed with Unity/Playmaker terms that much to understand the complexity of it. Would there be an easier, more rudimentary way to go about this? I dunno, sending out a raycast and having it bounce? I'm not even sure if that is possible. I feel that it might be simpler than it lets on but I'm kind of stumped. Besides that, I'm unsure where I could find resources to find these oddly specific problems I have - I don't want to be spamming the forums too much. Do you guys have any recommendations for resources?

Here is a video of the demo:

Thank you.
« Last Edit: May 10, 2021, 12:41:21 PM by patheticorganic »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Reflective Trajectory Prediction?
« Reply #1 on: May 13, 2021, 07:29:57 AM »
Hi.
For a racast you would do 1st 1 raycast and when it hits a wall get the hitpoint and do the next raycast from there.

This bullet holes tutorial shows how you place a image with the correct position/rotation.
But instead of using a bullet you could use the postion/rotation to do the next cast.


But that does not account physics like torque etc.

i did a quick google and i found this, but it does not show really how to do it.
its using a Physics scene i believe.

https://forum.unity.com/threads/physics-prediction-billiard-demo.615520/