#Can't find a way to stop the dashing when the player hits the spike (Assignment due in a few days)

1 messages · Page 1 of 1 (latest)

crystal reef
#

When ever I try to dash through the spike, the player would temporarily teleport to the checkpoint but then go back to where the dash was meant to land if there was no spike. Can someone edit my script so that when I dash through the spike, the dash would cancel out?

Just a note: I don't really know how to code and I am doing some difficult scripts. So if you can update my code, it would really help!

buoyant mountain
# crystal reef When ever I try to dash through the spike, the player would temporarily teleport...

you arent going to find people here who will write your code, but it is very clear what's happening here. your coroutine is still running regardless of this logic that is sending you back to the start. you need a way to cancel the coroutine and reset the player back to its initial state.
the spike hitting you can call a method on your character (whatever class is used to represent a character), which can then call methods in other systems like this dash script to let it know to reset

crystal reef
buoyant mountain
buoyant mountain