so the game im trying to make is where you need to collect a certain ammount of things and when you do you can go to the door and leave then it takes you to the next scene.
-dont know how to make collectibles
-dont know how to make the door take you to another scene when you touch it (and only when you have the correct ammount)
-also cant figure out how to make something spin but thats not a very high priority right now
ALSO for some reason whenever I copy and paste the script it just doesnt work, but it does work when i have it in a downloadable file so can someone plz send me direct file or someone elses thing that i can download from
ANYONE WHO HELPS will be put in the credits (if they want to be)
For collectibles you can easily use the collision component on any entity, to subscribe to collision events in your code and get informed whenever the players “interacts” with that entity. From there you can disable/destroy it and keep track of how many the player has collected.
The door can use a similar trigger, so when the player touches it you execute a method that does one of the following two:
positions the player at some other portion of your game world, if you are putting all levels in the same scene. You can have multiple levels in the same scene by enabling/disabling entities that correspond to the different levels.
use different scenes all together, one for every level, and implement a scene changing script. Here is a sample project for this:
The code Leonidas posted is a fragment of code that needs to be placed in a script.
It seems likely to me that you need to take a step back and review some simple projects and or work through some tutorials to get an idea of how the various parts of PlayCanvas work together and how scripts are structured and organized. This page is a good place to start:
If you aren’t already a programmer, PlayCanvas can be fairly difficult at first. But once you get the grasp of a few key concepts and how scripts are structured, it gets easier (which is not to say that it gets easy). What has worked for me is to fork a tutorial project and then use it as a “sandbox” to try out different ideas. Every time I want to do something new, I experiment with that one thing in some simple project where I have some basic inputs like a button to push already set up.
You’ll find a way just don’t give up.I felt exactly like you at times but I didn’t give up now look I’m running one of the biggest self made games on this website and soon on mobile.Just ask yourself what am I really trying to do,then find out what your really trying to do ,next take the challenge step by step no rushing
The tutorials seldom have “exactly” what you need. But they often have some significant chunk of what you need. So fork one and give it a try. Keeping it simple helps to avoid confusion. If/when you get stuck, you’ll also have a simple project that you can refer others to where it will be easier to see what is going wrong.