#Add Grappling hook/Swinging to my 2D mobile game?

1 messages · Page 1 of 1 (latest)

silver walrus
#

you have a raycast which rotates toward the mouse with the help of look_at() then you check if input gets oressed rhen you check if the ray collides you grab the point of collision the you do a simple radius calculation and set velociry to the tangent or something like that(might have ti di some research for the math because i might be waffling here)

but ive defintely seen some tutorials for that which go more in depth than me

craggy tundra
#

Appreciate the feedback!

But by any chance would you be able to guide me through doing it on Mobile? Since I don't really have a mouse so I wanna mainly use touch controls, would it be possible to just have a button to press instead of following the mouse instead for now? Im just trying to find out how simple it is to do basic grappling before tackling a more indepth mechanic, maybe like an auto aiming as a substitute 🤔

silver walrus
#

you could also do a more dynamic way but idk how hard that woild be

craggy tundra
#

oOoOO yeah that sounds like a decent alternative thanks

#

For the last part though, I'm clueless on how I would implement that since I'm still fresh, do you know of a way to approach that?

#

Like have a second joystick when pressing a button to be able to control a pointer like a mouse that can be used for the grappling

silver walrus
#

i guess you have a grapple button which once it goes down turns into a joystick then you simply grab the direction of the joystick on release and shoot a ray

craggy tundra
#

Very good ideas

#

🤔

craggy tundra
#

I'll try figuring out how to implement this stuff XD

#

Because I have absolutely no clue