Spider-Man Web Swing

For a more complicated one, I’d use a math map function, like what unity has, and map a range of fall speed to a range of desired walkspeeds/horizontal speed, really should write up that in depth tutorial

Actually, im much more interested in the point selection algorithm… i watched the video and messed around with it myself, but in the video it only shows the raycasting in 2d, doesnt really show how i can get an optimal y value for the swing, and although it acknowledges that the point needs to be adjusted so it can be optimal (ex: finding corners) but doesnt specify how it does this? I cannot find an optimal solution to doing that. I played ur game (which is awesome by the way) and u seem to have nailed the point selection algorithm, and im wondering if you can give me some pointers? I can show you the algorithm i have rn

Closed from copying.

Also, @OcularMaster , how I’m guessing it works is that the parts that you can select are in a folder. Then the script listens to whenever you move and uses a for loop in the folder. Then, the script compares each parts position to the player using .Magnitude and creates a GUI or something that is only bound to the X or Y coordinates.

No. Thank you for this advice but it is not a good solution whatsoever nor is it what is described in the video. Also, what do you mean close from copying?

Roblox doesn’t have a feature to just simplify a model like a building and grab all the planes, so you can’t recreate what Insomniac did 1:1, you’ll have to take some creative liberties there. What I did for my demo is just a spherecast in a for loop, increasing the radius until it hits something that matches my criteria. The criteria part is where I incorporated stuff from their algorithm, I try to make sure the point the spherecast landed on has a good angle, distance, etc, the different metrics they show in the presentation. Spider-Man 2 (The old one by Treyarch) did something similar but with raycasting in a cone that kept expanding until it hit something. Fortnite does the spherecasting technique but where your camera is aiming. I also change the spherecast direction depending on y velocity, like mentioned in the video, for fluidity.

2 Likes

Ohhhhhhh i gotchu. Yeah this method works great, I added that + a corner selection algorithm. Although, i noticed that this algorithm as well as in ur game will not always get a point, so i implemented another algoirthm that ensures there is an optimal swing point even if these raycasts fail/ Honestly i do not really understand the rest of what you did, for instance, where you said to set the walkspeed of the player to fallspeed…? for me, this simply stopped the player from being able to move… I was able to acheive a web swing as good as the one in your game using a spring constraint and different mechanics, however sadly it does not allow you to do 1-2 things that i lowkey need so im going to have to restart using a ropeconstraint. Do you mind doing some sort of tutorial? Oh, and by the way, i think that you should add wall climbing to ur game. would be a nice touch (i can show u what i mean in my game)

If it’s a simple model like a tall rectangle or square, you can get every corner of the model, and then build the plane out by finding the area of the points on the same face or you could do it the standard way and just define it via three colinear points or a point and a normal vector. Get the midpoint or pivot point of that face (assuming it’s the middle). If it’s more complex (more vertices), you have to break model into different chunks and do the same thing described. Once you have map of surfaces, you can compare the normal of where the web hit to the plane and then, kick off an action.

Since the graphical and processing capabilities are different per device (as compared to PS5 being the same per client), optimizing this to be fast and efficient is the tricky part and varies based on the complexity of the model.

I tried separating simple cubes into its sides and it was alright, but it’s just not worth the effort imo. Especially not if you go for something that works for more complex shapes like you described. It’s possible but it is a nightmare for just slightly better point selection than a simpler algorithm with spherecasting. Also, is this AI?

No, its not AI. AI is when you create an algorithm that learns based on the inputs and improves as a result. It might be considered AI if every time it selected a point, it somehow learned how to select even better points next time. But no, this is just an algorithm.

I was asking if their reply was AI generated.

OH LOL just run it through zerogpt. also please reply to my other response :crying_cat_face:

I’ll follow up with you via DMs.

Can you please send it here? So other can also see it.