So basically, I’m trying to make a platformer, but some of the levels are impassable, and if you press left control, you sacrifice your player to make husks which you can use to beat the level.
However, the code isn’t working as expected, Instead what happens is the player’s position isn’t reset back to spawn, and the husks dont even spawn on the player, but instead AT the spawn.
The Visual + Text code are both listed below (i know this forum is for visual scripting but i might as well add both for the sake of it)
Visual Code (Bolt):
Text Code (C#):
public GameObject huskPrefab;
public GameObject spawnPos;
public GameObject Player;
void Update()
{
if(Input.GetKeyDown(KeyCode.LeftControl))
{
Instantiate(husk, player.position, Quaternion.identity);
player.position = spawnPos.position;
}
}
On paper, it seems like it would work, but it just doesn’t, and I have no idea why, and this game is for a game jam as well so I’m on a clock here too (why)
I don’t know if I missed something or I’ve mixed stuff up, so if anyone knows what’s wrong here, please let me know!
(ps: pls forgive my atrocious code organization, i’m not really a programmer lol)
(pps: and also if you didn’t understand any of what i just described pls let me know)

