Hello! I want to visually imitate a rope between my first person controller and a static point in 3D space. I’m fine if it’s just a plain cylinder which changes its height and angle when the player moves.
The angle is actually what I’m struggling with, I need a code snippet for it in GDScript. I’m also not sure if its position must be calculated relatively to the player or globally.
You can assume that the cylinder is created as the player scene child node, it’s MeshInstance3D with CylinderMesh child, it’s named as _rope_mesh, and its needs to be updated in player’s _process() function. Sending grace rays upon you all.
I appreciate your effort. However, I need a solution with rotation in all 3 axes. Your solution is top-down, only for horizontal plane. I think that the problem can be solved without touching individual vertices. Something like finding a vector pointing from the player to the target point and then rotating the rope mesh along the vector.
Hey! Thanks for the code, It was exactly what I needed to create a “Grapling Hook” effect for a fps controller. I basically used a raycast collision point as the “to” parameter and the player position as “from”, it worked flawlessly.