#Faking a "Rope" using Velocity on a player

92 messages · Page 1 of 1 (latest)

turbid sentinel
#

Im trying to make a grappling hook that uses more of a rope than a spring

It has a set Max Length and Pull Force

Assuming pull force is 0m/s for now, how can I ensure the length of the rope never goes above the max rope length (Within reason of course, doesnt have to be perfect, I just dont want it to be a spring)

This way players can actually swing on the rope, instead of akwardly swinging while also being pulled towards an object

My initial idea is to pull them to a position that is (MaxDistance)m away from the hit position if they are greater than (MaxDistance)m away from the hit position
I just worry that this method will have a player try to go backwards in some cases

halcyon fiber
#

While I don't have a solution, here's an idea, why not instead of using the exact hit position as the target to go to, the target is underneath the position equal to the distance of the rope.

#

So say the rope is 5m, the target would be 5m underneath the hit position

turbid sentinel
halcyon fiber
turbid sentinel
halcyon fiber
#

Ight

turbid sentinel
#

I have a "Meters to degrees" invention, which uses a Radius and Meters input, converts it to radians, and then converts that to degrees

My idea is to go to a position that is MaxDistance meters away from the hit position, but that is also rotated that many degrees based off player velocity, on the axis of the swing axis

halcyon fiber
#

That's a whole lotta words, sounds good to me RRegg

wheat thunder
#

When i created a graplin Hook, i set the velocity add to the Y of the trigger handle rotation, so when you look up you climb the rope, and when you look down your descending the rope, and at some point you can just stay still in the air.

#

@turbid sentinel

fallen rain
#

ultimate solution: set velocity to player's current "swing velocity" combined with "rope length"

#

im still waking up so sry if I sound stupid

turbid sentinel
#

im not using set velocity

#

I think this can be done with purely Add Velocity, I just need to know what to set the strength to

#

Maybe I can do something with dot product?

#

The further your velocity strays from the rope, the more it adds towards?

fallen rain
#

use something like that?

#

idk

turbid sentinel
#

How would I find the "Swing Axis"?

The axis of which you were swinging around

fallen rain
#

you would need more than one axis anyways

#

you would want to calculate this based around the point the rope is coming from

turbid sentinel
#

Just the swing axis would let me rotate it to fake the curve

fallen rain
#

but that sucks

#

and if you build that, you suck by association RRtroll

turbid sentinel
fallen rain
#

The best solution is some maths that can calculate a swing in realtime in 3D space

turbid sentinel
#

how to I find swing axis tho

halcyon fiber
#

You'd somehow need a way to curve the line

#

Imagine you grappled from the top of an object

fallen rain
#

but you have to realize this rope is not in 2D space it is in 3D space

#

you need more than a swing axis if you want it to be good

turbid sentinel
fallen rain
#

what

turbid sentinel
fallen rain
#

you don't seem to understand !!!

#

there are curves that would require more than just one axis

turbid sentinel
fallen rain
#

i think

#

ok build it and i'll show you the critical flaw RRtroll

turbid sentinel
fallen rain
#

but uh just make the axis based on the direction you are facing the point when you first grapple idk

turbid sentinel
fallen rain
#

no

#

no no

turbid sentinel
#

Do you understand what the "Axle" on a car is?

fallen rain
#

I mean you can find an axis based on the direction between you and the point

turbid sentinel
#

ah

fallen rain
#

i hope i make sense

turbid sentinel
#

but yeah

Think of the axle of a car as a vector3, and the wheel as the rotation

The wheel rotates perpendicular to the axis

fallen rain
#

am aware

#

but the thing is

#

a rope can curve around a point in its swing

#

like

#

not just on one 2D axis

turbid sentinel
fallen rain
#

no

#

not what I mean

#

quick question: how much sleep did you get last night

turbid sentinel
#

i havent slept yet

fallen rain
#

makes sense

turbid sentinel
#

y'know what im deadass about to try

fallen rain
#

i'd go get some sleep before you deadass try anything

turbid sentinel
#

adding velocity based off the dot product, not curving at all

fallen rain
#

problem solved 🤡

turbid sentinel
#

now im thinking

fallen rain
#

thats rare

turbid sentinel
#

How would I do it off dot product

fallen rain
#

you wouldn't

turbid sentinel
#

If im perpendicular to the direction, add nothing
If I am facing 1 or -1, add

#

ill litterally try taking absolute value

#

its probably not going to work at all

#

but im doing it

fallen rain
#

i

#

i have no words

#

have fun!!!

turbid sentinel
#

You havent helped me at all bruh

#

im just trying something

fallen rain
#

To be fair, i'm not sure if you have even helped yourself in this interaction

turbid sentinel
#

thats because this is confusing

fallen rain
#

it is

#

my head is in pain

turbid sentinel
#

Im going to try something else first thats harder to explain

#

Basically, adding velocity.. "Forward" relative to the axis

fallen rain
#

ok

#

i have my doubts about that working