Route with lines

image

can someone give me a way to do this in a smart way, I did something to test it, but I wanted a way, any tip would already help me

https://playcanvas.com/editor/scene/1113850

Hi @vgupgrade,

If you would like a quick way to draw a path for debugging you can use the renderLines() available here:

https://developer.playcanvas.com/en/api/pc.Application.html#renderLines

Otherwise for a more production ready solution you could use the pc.Curve class by inputting your path points and getting in return linear access to any intermediate point. Where you can easily place dummy spheres or any other entity to visualize your path.

On how to use pc.Curve with path points check the following example:

https://developer.playcanvas.com/en/tutorials/camera-following-a-path/

1 Like

I liked the pc.Curve thanks.

to create the points, I’m using:
resource.instantiate ();

so I’m applying force with:
rigidbody.applyForce:

in each collision I create the point:

am i doing it right or is there a better way in playcanvas?

are you looking for something like this from lexxik:
ball with footprints

@LeXXik I mean the one with the jumping ball, which leafs collored stars on the ground; but he ask for lines :thinking: I guessed the idea from the picture

1 Like

@Gurki not sure if your link is correct, but that is not my example. You probably meant this one?

https://playcanvas.com/project/692652/overview/curved-collision-detection

2 Likes

hi guys, this one is an example, that i found on the web, when colliding i wanted to show the way the ball would trace.

image

Assuming the bounce is perfect, you can use raycasts instead and place spheres along the direction and path of the raycast.

1 Like