I'm using the code for level changing from this post: Level Changing Level Changing So the player is taken to an end game screen. Works fine when the player makes it to the touch entity but now I want to do the same thing when the player dies. I want to include in the player code something that will call up the function from another script. Is that possible?
Sure, in your player code, where ever you are handling the death sequence, just simply call the function.
Assuming you are using separate scripts, as long as each separate script (player script, level change script) are included using an include statement in your main script, you should be fine.
Re: End Game Screen
[Re: xbox]
#435015 01/01/1421:1401/01/1421:14
I double checked the includes and I have the player script and the level change script included. I think it's how I'm calling the function:
function level_Change();
I've included that in the player script but it won't run. My guess is that my syntax is wrong but I don't know how to call the function from another script.