User N Dev log - To hell and back repeatedly

Mondays, mondays, mondays. The most infamous of the week, I drag myself to write something about this day that felt so unbearable. All started when I had to link the puzzle piece to make this Door/Key system work, just to make vanish the Key after being used. I had to rework, knock the head into C# and sneak around some seemingly impossible design challenge. I had to compromise to make it to make it somewhere.

DOOR/KEYS

acacac.png

It all start with a key prop to be left laying around for the player to pick it up. Turns out though that in unity changing proprieties is not very straightfoward so I opted for a change of object with the same look but different functions.

dawwwew.png

keyringpop.png
This part was not bad but having to write down the code and then connecting the interacting object in another panel is confusing at first and increase the chanche of making mistakes.

After hooking this keyring to the collision with the player it was time to create a prefab that can be spawned from the pick up. Here started the problems because now I had this cool floating key over my head it just had to collide with the door object and destroy it, plain and simple.
But things got messy because the unity editor has a tag and I don't know if my code had something missing but the tag does seem to work too much because the key get destroyed even with other objects that are not even tagged.
whhhhhherh.png
The key hanging from the tower.

Now onto the clutch point that still is left partly unsolved the KeyRing and Door interaction.
These two following are the objects.

KEYRING

wfwefwf.png

When spawned from the colliding key prop it start following the player and floating at Y 4 above the player.
In the late Update it renew it's position close to the player + the offset of 4.

followpla.png

Then we have the destroy event when colliding with the object tagged Dorr.
The part that still I don't grasp is how void, private void and public void should be used, it works this way but only with RigidBody set to convex and it only works with OnTriggerEnter and not with OnCollisionEnter. I would have loved to have used the latter because it would have left me without item having the Trigger Box checked out that change the way their physics works

KeyDestr.png

DORR

wqdqggg.png

Very similar to the KeyRing prefab the the Dorr prefab has it's destroy event and while not having a Convex RigidBody it is set to Trigger in it's Box Collider

doordestr.png

Like the KingRing one it checks for the other collider tag and then goes on to destroy itself.
I wanted to do everything down in one script as I usually do with Game Maker studio by first destroy the other target and then destroying the object were the script runs but here after having tried more ways of Destroy(other.gameObject) without much success I opted for this two identical script. For now it seems to be working fine.

Though the fatal flaw of this system is that when carring around the key the player need to be very carefull about touching any wall because that may trigger the destroy event and I still haven't gotten around to get why. I designed it as a challange that the player must bring the key to the door with care and giving some backup keys for having multiple tries.

I have done some new changes and added new sub levels that make me very happy and hopefully now that I can interconnect more levels more ideas and design challenge can be made with more concentration and focus.

wefwfwfwf.png

Here's a shot from the Project Sand level.

Have a good week everybody, monday is done 😁👨‍🌾



0
0
0.000

3 comments


I am very glad that you have made progress and that you are satisfied with what you are doing to bring it to a full successful completion.

It is fabulous the programming work you are doing. Although I do not understand all the language you use to do your programming, it is extremely interesting and it shows all the passion that moves you in your excellent work.

Thank you for sharing your knowledge and hard work dear @mproxima. I hope you manage to fine tune all your projects and finish them successfully.

A big hug!


0
0
0.000

I don't either understand too much of the language myself and struggle a lot with it but it is necessary to create what I intend from a game design vision.
Trying to pull through ahah. Thank for your inspiring words 😌

0
0
0.000

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000