If i understand correctly you wanted to streamline teleporting process
So that when you touch doors outside it save your current position but sends you wherever you want
So that when you touch doors inside you go back to that position WITHOUT need to specify it in X and Y but just using position saved to variable
In this case global variables are well GLOBAL and work across whole project including all scenes
So it would always send you back in front of doors you entered with
I still can’t see any reason to go with changing scenes instead of just going for different position outside map
But it is your game you know what is best for you not me not anyone else
If it works like you said then this is all that matters
Tbh I didn’t think of using global variables I’m gonna try it. And I just wanted to do it in different scenes why IDK LOL. I’m now in the learning phase so any advice you say I’ma take it. Tbh your method is so easier and effective than mine and saves a looooot of time so if anyone who has my problem I will suggest 100%your method cuz it’s easy as I said and beginner friendly doesn’t require a lot of work and do the job
Anyway thank you so much @ZeroX4 for your help I really appreciate it you’re a savior man
You see cause you want to do what you are seeing
You do not consider doing something else that would look as what you are seing
This will be example and another tip that will most likely come in handy
Imagine like in mario game you have coins just floating in the air
For player to pick them up
Your initial idea is to delete coins on collision with player to make them disappear and add +1 to coin count for each coin collected
Now you created a problem
How to spawn them back in exact same places?
Well doable but complex work and will need a lot of setting up in events to make it flawless
Now you go this way because it is what you see so you assume you need to delete these coins
And how about you do not delete them?
You change their opacity to 0 when in collision with player and only add +1 to coin counter for coins that opacity is 255 (255 is max opacity)?
Coins are still there you did not delete anything so you do not need to respawn them
You only need to set all coins back to opacity 255
While for you or any player it will still look like coins were deleted
You faked deletion effect yet you made your life easier
DO NOT ever try to do stuff as you see it if it is problematic
Try to think how you can fake effect doing something else
Same thing is with raycasting
Ppl often want to use rayasting to so enemy can spot you
Kinda like imagine having flashlight light if player is inside that light enemy see you
1st thing you and others will think is best is to raycast from enemy and if it hits player then you are spotted and enemy goes into attack mode and chase you
(BTW raycast is nothing else than creating invisible line from object and checking if it collides with another object on its path)
And that is a solution but imagine you have 100 enemies on map and every single one of them raycast
Look how your FPS goes down (just kidding won’t be so bad but it eat up performance)
How about you raycast ONLY from player and check if it collides with enemy object?
For game it does not matter who is raycasting as long there is connection between objects
So instead of having multiple objects raycasting you now have only ONE
And it still works exact the same way and do exact same thing
You want to use shovel to dig holes for plots and so when you do so you see dirt
1st idea make whole ground each grid a plot
I ask why?
How about when you have shovel in your hands press interact button to dig a hole to turn grass into dirt
Maybe just do not have grid made of grass plots
How about you just spawn object called dirt hole on top of grass?
This way instead of having whole map covered in grid of objects and switching these objects to different ones or simply switching their animation
You create that object when you need it to be there
While not pre creating tons of objects you do not even need
Think outside of the box
tbh thats genius for your method i see its the best way for a beginner to use like me.
the method that im trying to use is a bit advanced and challenging. your method was in my mind and a lot of games are using it like undertale and a lot of top down / platformer games. im just messing around here trying to create diffrent game mehcanics just to learn i said couple of times That im in the learning phase i still have a lot of things to do and to learn thank tou for your help till next time
Hey im running into a new problem lol.
i created a Player Health System In The main Scene everything is okay the damage and the healing is good but when i go to the other scenes it dont load The player Main Scene Health I was Thinking of using Global Variables for It but Idk How To do It How Can i Do it ?
like idk how can i set those variables to global ones
You simply change them to global
There global variable conditions and actions
So i do not understand what you are struggling with?
when i set it into global variables theres something that i cant see the player is getting damaged but the health curser dont go down like this
Here is the events that i used :
Hey i used ur advice and im using the easy thing
im using now the health extension but still the same prob
i dont know how to save the players health after getting hit and switched scene
You switched to global variables yet you left expression object variables
So what did you expect?
Variable called Health
Would look like
As object variable Object.Variable(Health)
As scene variable Variable(Health)
As global variable GlobalVariable(Health)
So in your last event not
And in change width of health
you’re talking about the last one that i send right ?
I am talking aboiyt this one
A hey Thank you for saving my As* Again idk why i dont notice the simple details thank you again the first method worked and im just gonna ask if you want about the second method how can i make it work i tried switching everything to Global Objects but it still dont work anyway thank you for helping again i do really appreciate it
last thing im gonna ask is how can i delete this object when its on collision with the player i used the delete object beahvior but when exiting and comeback after it just appeared again.
for anyone that want it:
2nd method of what? i do not understand?
Also switching what to global object?
Or you mean variables to global variables?
So as I said I used the health extension as a 2nd method
The problem that I tried switching everything to global variables but still when switching scenes the health go back to normal
This isn’t even the initial question you opened this topic for. The correct approach when you have a different doubt is to open a new topic and resolve it there, instead of continuing to ask in the same place. This is done for the sake of organization: when new users search the forum for answers to their questions, they should find topics properly titled with their respective discussions. However, if a user in the future searches for answers in the forum about the problem described in the title (which is already marked as SOLVED), they will be quite confused when reading comments that do not belong to the initial topic.
That said, there are many topics in this forum asking the exact same thing (regarding health and any other counter, transitions between scenes), and many describe how to solve it, but the advice is the same: use global variables. If this isn’t working in your game, it might be because the expressions (not just the actions) are still pointing to object or scene variables (by the way, global objects are different from global variables), or because you have a mechanism at the start of each scene that resets the health value… but it’s YOUR game, only you know how it’s made and what mechanisms you’ve put in it. When you make changes of this kind, it’s likely that the issue won’t be fixed just by changing a variable to a global variable; you may also need to modify the expressions that reference that value and possibly adjust the mechanisms that set the health value at the beginning of the scene.
As Erdo said you should start new topic on this
But you are setting global variable to what health extension have
You should do other way around set health extension value to what global variable have
Start new topic and we can continue if you want
Alright Alright im Sorry !
problem solved Thank You Man<3