[SOLVED] Prewritten script bank?


#1

Is there a such thing as a script bank resource? Sorry, I have no idea what I am doing haha (just got playcanvas yesterday.)

I am an art teacher for middle school students and I was hoping to use this program with them but trying to figure it out myself first and see if it would work. Because I am not teaching a coding class, I do not need to teach the students how to code (thank goodness because I have no idea how to myself) but rather would love for them to do a little world building. I was hoping there would be some way I could use a premade script so that an avatar could walk around in the world they build. I was able to get the premade robot into the game and I saw it came with animations, however, I have no idea how to script him to move. Any an all help would be greatly appreciated!

Thanks!
Sarah


#2

You can look at the finished tutorials and use these examples to build your own scene.


#3

As @MasalovAndreey said, try looking for a tutorial and fork it. Then you can edit the world from there.


#4

Thank y’all! What are legacy scripts? I just tried to “fork” something and it said I could not.


#5

What do you mean you could not? Does an error show? Next time you try to fork it, take a screenshot of any errors that show.


#6

The more I am playing around with the program, the more doubtful I am that it’s going to be something I can learn and use in my class. It’s taken me two days just to create a ground, sky, two boxes and put the robot in haha. The robot comes with animations, but I haven’t been able to make those work. I was hoping to see if I could use the script of the girl or lion walking from this game to add to the robot in mine.


#7

(It asked me to make a second post for an additional image)


#8

Older projects (pre 2015 or 2016) used the older version of the script system which is no longer supported hence you cannot fork from them.

You will need to do some coding with PlayCanvas to get what you need. How much will vary based on the level of interaction you need with the world. If it’s just a flat plane, you can use https://developer.playcanvas.com/en/tutorials/first-person-movement/.


#9

Ahh okay that makes a lot of sense. Is there a script written for walking around the world in third person? I like that robot they provided, I’ve been looking for a tutorial on how to animate it. I tried to use the animation blending one, but that didn’t work. Thanks for your help!


#10

This is the closest one that I’ve seen but the project is a little broken for some reason: https://playcanvas.com/project/569492/overview/tutorial-third-person-camera

Edit: I’ve forked and fixed it here: https://playcanvas.com/project/628184/overview/third-person-camera-fix


#11

Awesome. Will try this out. :slight_smile: Thanks so much!


#12

This is amazing! Exactly what I was looking for, and I have been able to edit the world a bit. I am ecstatic and can’t thank you enough. :slight_smile:

I went to add a new entity (primitive cylinder) and for some reason the man walks through it. I have collision turned on for the same radius and height as my entity, do I also need to edit the script or add a collision setting to my model? Sorry to bother, if you don’t have time, no worries, I’m sure I can fiddle around and see if I can figure it out, I still can’t believe I have a working avatar and camera now!


#13

Nevermind! I had not added the rigid body :slight_smile:

Thanks again for all your help!