How do I change the form of a mesh?

How can I do what is shown in the video below? Let me explain what I believe is going on. I think it’s probably somehow breaking out pieces of what looks like a mesh when it’s colliding with a part. I’m not sure how it’s done but it probably has some type of advanced scripting or something else I never heard of before. Can I have some help with scripting the same thing or something similar? I also never really tried this before cause I’m not sure where to even start with something like this so help or an example script would be greatly appreciated. Thank you in advance.

Video I am talking about:

Also I don’t know what the box is in the bottom left of the screen but it appeared after I recorded it

1 Like

Looks like something that can be achieved with raycasting and a SurfaceGui;

Raycast from the position of the soldier in all directions around the soldier (with the raycase length as the radius of the circle), then if any object hits the raycase, the soldier cannot see in that direction.

Then you can use some GUI tricks to make the circle based on that knowledge. Perhaps make a circle out of circle sectors, where the casts you send out are the edges of the sectors, then if a raycast labels an area as obstructed, make that sector invisible to show there is no line of sight there.

I drew a diagram to aid understanding:
image
Red square is the soldier,
Black lines are raycasts which dont hit anything, so their sectors are fine,
Blue lines means the raycast hit an obstruction so sectors are not fine,
Red sectors are obstructed,
Green sectors are free.

Do this but with more raycasts for a better resolution of Line of Sight for the soldier.

Hope this helps.

yeah I thought it had something to do with raycasts i’ll try some things and let you know if it works

1 Like