• Hey! Register here to create your account, engage with the community, and talk about what is new!

How to make a "Blink" ability?

onion_hq

New member
Joined
Dec 23, 2023
Messages
14
Reaction score
0
I'm trying to make an ability for my game that allows the player to teleport a few blocks in the direction they are facing, but that obviously has come with the issue of the player getting stuck inside blocks or getting into places they're not supposed to. I'm wanting it to be that if the path of teleportation were to intersect a block, the teleportation distance is cut short so that they don't go through or get stuck inside
 

Candl_

New member
Joined
Aug 5, 2023
Messages
6
Reaction score
0
There might be a way to create a raycast, then check if the ray intersects a block. I'll follow up to this if I figure it out.
 

ImaLEAF

Forum adept
Emperor
Joined
Sep 20, 2021
Messages
157
Reaction score
23
Raycast from the body location with solid block collision enabled (though please use the set variable version and not the select object version) and shift the location you end up with backwards a bit to avoid clipping into walls
 
Top Bottom