(Solved) Scene resetting and weapon position

Im making a top-down game, i have 3 scenes in total consisting of two rooms, and the third scene called CodeScene which is a pop up which displays a paper with a code on it when i make collision with the book, one issue im having with the game is, i have a gun, however when my player collides with it, it gets picked up but its displayed on the players head, and im not sure how to get it to be in his hands, ive tried changing the points but im doing something wrong.

Issue 2 is, in room 1, there is a key, and u need that key to unlock the door to get to room 2, however when I go back through that same door in room 2 to get to room 1, it resets my character, its currently at… if player collides with door, change room to scene 1… not sure how to make it so he appears in front of the door rather than the whole scene resetting.

Issue 3 is when my player collides with the book in room 2, the code pops up on screen, but when it pops up, everything resets and i cant get it off, what I want is when player collides with the book, the code to popup, while room 2 is paused in the back which is the room he is currently in and where the book is, and pressing ESC resumes the scene without anything resetting,

Hope this makes sense

Do you need the code scene to be a scene? If not, consider just making it on a different layer and when they hit the book or w/e have the camera in that layer tween to the code paper and when they hit escape you can move the camera off it. Also i think you can still pause the game doing it like that, I’m always seeing people in here changing the timescale in their events.
The door thing is supereasy and there are so many ways you can do it. In fact there was a post a few days ago

in which i offered a simple and rather brilliant solution (hehe) and the other guy had a good solution too. So he has his events up you can look at.

The gun thing what are your events for?

For issue one,
go to Edit Points on your Player character. Create a new point, called something like “Hand”. Move that point to the area where you want the Gun to appear on the player.
Then goto Edit points on your Gun sprite. Move the Origin Point to where you want the Gun to connect to the “Hand” point.
So those points would be the two connecting points.

Action…
Create Object “Gun” at Player.PointX(“Hand”);Player.PointY(“Hand”)

That should do it?

yes thanks alot, just gotta adjust the size but it worked!!

okay so ive been doing it, and first i tried the external layer and i couldn’t manage to do it, and then i read something about making a layer and in events do at the beginning of scene hide the layer and when in collision show the layer and then was wondering i also wanna add something along the lines of press a key to close/hide layer. i want to do something like that, this is my first game, im struggling with the layer, i cant manage to make it hidden at the beginning, need to know the code for it being hidden at the beginning, and shown during collision, and key pressed for it to be hidden again.

i have a deadline its why im in a rush : (

I think in actions not conditions search layer and it will pop up for you to hide a layer. You can put it in your begin scene events. You do have to specify the name if it’s not your base layer, so just “LayerName”, it should show up in your list.

Later events in your script, under conditions not actions search layer and you should see one that says layer is visible, select that. In the same block of condition add your desired key press. Then in actions for that block do the hide layer. Also in the actions of that block do - set boolean variable Close of object book to true.

Mkay then a new block of conditions, copy your condition for the layer to be visible and paste it in there and invert it. Then add your condition for the collision to open the book in same block. Then add one more condition in that block that says boolean variable Close of object book = false. Then in actions for that block do show layer.

Now in a separate condition block do condition player is not in collision with book. Add condition boolean variable Close of object book is true. In actions set boolean var Close of object book to false.

Hope you meet your deadline and later when you have more time you can play with tweens they add a lot of polish.

I did it, tho something isn’t right, i think i did something wrong, not sure what it is tho, here is my script for the second room.


My layer section maybe something is wrong here


And this is where i think i got it wrong.

I’m sure you didn’t do anything wrong it’s probably just something i didn’t account for. What’s it doing or not doing so we can narrow down what the problem is.

well whenever i click preview and play, once i enter room 2, the codepopup is already on screen, i carried on playing, and got my player to collide with the book, but nothing happened

In your scene editor, when you click the little eyeball on the codepopup layer thing you showed me in the image, does your code sprite still show or does it disappear - in the editor, not preview

Just asking to make sure the code sprite is on the right layer, you can also check by clicking the sprite and looking on the menu on the left to check which layer it’s on

i clicked on it on the left it says base layer-

Ok move it to code layer and update me

ive changed it to code layer and it works thank you ^^
I’ve also added a text saying “move away and press esc to exit” it works, i have one more thing left, in room 1 there is another door which is the exit, but i need to implement a passcode system which is what the code is for, haven’t added it yet, tho its the last thing left I believe, do u know how I can do this so it only opens the exit door if the code entered is correct

1 Like

Not offhand, I’ve never worked with text input. Best thing to do is search through the forum or throw up a new topic for that question to give people that know a chance to help.

alright thanks for everything!