#Thread
1 messages · Page 1 of 1 (latest)
oh ok
okey
Is it maybe smart to show you what i am working on and then you know the context etc?
probably best to show as much info as possible all the time when asking for help..
i feel like u might have skipped some basics as well 😐
and started straight into stuff u dont fully understand.. tbh
could be
I started with a book Unity for "anfänger" (beginners)
And thenI thought lets just make a 3D Game, and learn while doing it
Do you maybe know how to make it that when I click smt in game it teleports me to a different scene?
here's a fixed one that doesn't try to use my SPWN namespace.. even tho i had it included in the first one..
alr let me try in a few mins i finish the one tutorial real quick
no prob..
ok now
i sent Alll that.. basically to say ur issue w/ the pause menu and the button is that ur pause menu probably never makes the cursor state back normal so u can click the button.. and step2 came naturally that to make sure this stuff is done easily is to have only (1 set) of code that does ur locking and unlocking/ hiding/not hiding cursor stuff
https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Cursor-lockState.html
tut works :D
👍
now yours hold on
hey. atleast i got mine to recycle all across my many many projects 😄
mines a bit more geared towards scaleability since u cal call the singelton from anywher
ohhhhh..
i dont remmeber sending those..
this is all thats in that package..
\PAK\ folder shouldnt even have anything in it
OHHH
i sent worng file again
what is yours what is mine? my organisation is a mess
SPAWNKIT is a bigger project
Pak deleted Minus 6 errors
is this yours?
still 12 errors
theres some more stuff.. if u have AntennaSpring folder delete that.. then Pak. the two TF folders..
SpawnCampGames folder.. and Extra folder
and then u should have it cleaned up... i cant believe i sent the wrong file 🤦♂️
you should have caught it too... lol the name isn't even anything to do w/ Pause haha
i just thought holy shit is that much
cant find the other folders
i cant believe it (╯°□°)╯︵ ┻━┻
but no errors anymore
no.. like little.. ^ i showed up above
you'll be able to read everything better
okay.. yea none of that is mine
nope
Test may be something.. but everyone names stuff test..
WhiteIconPack is mine
thats it..
was a tut about a other topic
ohhh..
check first before u upload
you can see what files are coming in.. this one should only be 3 scripts and a scene
looks good
yea open pausetest
in the pausesystem gameobject theres a place to chose which key pauses the game..
well which one opens the menu..
ehm
u can chose w/e but like i was saying earlier.. its nice to test w/o using the escape key
noooo way!
theres not even that much code
Very Very Very WELL
👀
21 is a nice umber
number
so how do I intigrate that now tho?
I moved that now to the "serious shit" folder so I can find it more easily
the CursorController.. u just set that how u want it when the game starts...
umhm but on what gameobject?
then.. anywhere in ur script u can call CursorController.Instance.Lock();
or.. .Confine .UnConfine
can I copy paste your scene thingy to my scene(s)?
.Hide() etc.. u can see an example in the PauseSystem script
wheere mine says MasterMouse.Instance urs would be CursorController.Instance
and if u open that script.. theres ALL the different functions u need..
that way.. when u pause or unpause or ur controller needs to hand over the mouse or w/e u can just use that same line in those scripts
can we maybe screenshare and you show me or smt?
sounds good i think
or are you still at work?
how late is it where you live? for me its 8:30 pm
check it.. you just need those couple of gameobjects.. put it in any scene u already have..
add scene -> copy over gameobjects -> remove scene without saving
so yes?
like all things in your scene copy then my scene paste and pow it works?
the only issue you may have is if u already have an event system.. you only need 1 of those.. the pause system gameobject needs a reference to it.. whichever one u chose to keep..
then i choose yours ig
can I change your first not pause canvas to mine without an issue?
u can use whatever EventSystem you want... i just had to include one w/ the package
my ButtonTester script uses it to unfocus the button after u click it.. thats all it does.. u dont even have to use the ButtonTester script
wait a minute
and last thing to mention really is.. in the pause system script.. (since in my example thats whats controlling everything, like the menu, and telling the cursormanager to lock and unlock) it needs to also do the other things..
like in the vid example ^ i would tell my character controller when it can and can't move.. as well as other scripts like the camera controller.. not the other way around..
in ur scripts u sent.. u had the character controller changing the cursor itself..
but thats how most tutorials do it.. b/c they dont have to build the entire game w/ all the systems working together
but the game needs to be paused completly?
yea.. u'll need to add the time stuff.. i mentioned that i never added time.. scaling..
b/c i dont really pause that way
i'd like my time step to continue while i have things paused.. the pause system can be added onto.. like i was saying to stop the character, stop anything else that needs stopped..
u can add in the timescale stuff in there if u need to
if(Input.GetKeyDown(PauseKey))
{
if(isGamePaused)
{
//game is paused, lets unpause it
CursorController.Instance.HideCursor();
CursorController.Instance.LockCursor();
//disable the pause menu
pauseCanvas.SetActive(false);
//mark our system as unpaused
isGamePaused = false;
//set your time stuff to 0
//myCharacterScript.canMove = false;
Debug.Log("We've successfully unpaused the game.");
}
else
{
//game is unpaused, lets pause it
CursorController.Instance.UnhideCursor();
CursorController.Instance.UnlockCursor();
//enable the pause menu
pauseCanvas.SetActive(true);
//mark our system as paused
isGamePaused = true;
Debug.Log("We've successfully paused the game.");
//set your time stuff to 1
//myCharacterScript.canMove = true;
}
}```
I changed the Design a bit and it now looks so good and the buttons actual work
whats that?
its the pausesystem script in that package
have u not looked at all the stuff in there yet?
if (GameIsPaused)
{
Resume();
}
else
{
Pause();
}
can I paste it in your pause manager?
wait no
wrong
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PauseMenu : MonoBehaviour
{
public static bool GameIsPaused = false;
public GameObject pauseMenuUI;
void Update()
{
if (Input.GetKeyDown(KeyCode.Escape))
{
if (GameIsPaused)
{
Resume();
}
else
{
Pause();
}
}
}
public void Resume()
{
pauseMenuUI.SetActive(false);
Time.timeScale = 1f;
GameIsPaused = false;
}
void Pause()
{
pauseMenuUI.SetActive(true);
Time.timeScale = 1f;
GameIsPaused = true;
}
public void LoadMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene(0);
}
public void QuitGame()
{
Debug.Log("Quitting game...");
Application.Quit();
}
}
Almost that whole stuff
not sure how well copying and pasting thigns back and forth gonna work out..
thats why i sent mine in an example scene solo.. jsut so u can get a feel for how it works together in that one little scene..
okey
u can then write ur own.. or adapt it however u need
good luck..
thanks!
quit button works
main menu button works
now working on resume button
thanks again
@rose elbow everything works fine!!!!
Thanks
Wait I cant Pause the game again after I unpaused it
well..
pauses and unpauses as it was..
only thing i can think of is you're unpausing some other way besides the pause key thats setup..
if its anything its b/c the boolean isn't getting set back to false when u unpause it
wait its a mistake from me
otherwise it'll just try to unpause it again
how do I change it so i can change it in unity editor?
leave it blank
ok
leave it empty.. and just assign it in inspector
gotta run.. 🍀 probably be back on later
hmmm still doesnt work
alr
start debugging as much as u can.. try to step thru it piece by piece and find something that might not be working exactly how u think it should..
thats the best i advice i can give for now 💪