Question regarding Game Objects and scripting

Hello, everyone. I am new to this forum and new to Unity3D as well. I have a question hopefully somebody will be able to answer it for me. This is want I want to do in my game. (Well, it’s not the only part but it’s a main feature of the game). I’m not sure if Unity will allow me to do this and my question is if I can do this, how can I? What I would like to do is create all of my game objects in some sort of modeling software and then import it into Unity. I would like to make everything unique. (In other words what I am saying is I do not want to create like five different looking enemies and then keep spawning the same characters each time. What I want is for each person and item in general to be unique and once you kill that person you will never see that exact same person ever again…that is unless you use the revive tool that I plan to place in the game). Anyways, moving on, the big feature of my game is that the player will have a weapon that allows him/her to do whatever he/she wants. (For anyone that has played the game Scribblenauts, this is what I am getting at.) So, let’s say I see a cat on the street, and I don’t want that cat to be a cat anymore, I want it to be a dog. So, I would use my weapon and target the cat, and then a screen would appear where I would type in the word “dog”, and then magically the cat turns into a dog. You would also be able to do this for properties, like say turn a skinny person into a thicker person, change the color of somebody’s hair, etc. And, finally, you would be able to do this for any object in the game, so, let’s say I wanted to turn a building into a horse, I could. (Would that be kinda weird, yeah, but, hey, open world games have been really serious lately the only real exception to this trend would be Saints Row so I thought I would try to make a game that gives the player a lot of imagination and fun.) I was kind of thinking that what I would have to do is make subclasses of the Gameobject class and each subclass would be each different type of real object. So, I’d have a human subclass, a dog subclass, a building subclass, a tree subclass, etc. And then I would try to have a huge list of properties like a .FirstName property, and .LastName property, etc. even for the objects like buildings. (Because I said you could change a building into a person and then I’d like for the player to be able to name that person if he/she wished to. The thing is, how would I be able to do this? Or is there an easier way to do this? Thanks!

Hey Scott, welcome to Unity! In the future you might want to break up that wall-o-text with some line breaks. I have a feeling not many people will muscle their way through it.

So, what you want to do is certainly possible, at least as much as Scribblenauts did it. What they did (and you’d have to do the same) is have a huge library of different objects, and then an even larger dictionary mapping nouns the player might enter to those library objects. (You could use WordNet for this, which groups words semantically; so if they enter “salmon” but you only have a model for “fish,” you could automatically fall back on the fish model.)

All of this is extremely ambitious, and you’re new to Unity, so I’ll give the standard (and very good) advice: put this project on the shelf for a couple years. You need to level up your skills before tackling this boss monster. Start with the Learn link at the top of this page; do some tutorials, make some simple games. Then come back to your dream game.

And make use of this community — we love to help!

Good luck,

  • Joe
1 Like

Yes, totally doable, but yea, ambitious, but still, totally doable…

For the randomness, something we’re making hella use of in our main project, what you need to look for is morphing. Its semi easy to do in C#, but you’ll want to make all your char models from the same base, ie, they will need the same number of points, and the points should roughly correspond… really, you’d only want two, maybe three models for this, because your going to want to randomly select values between the two models. I would use a second pass if using a third model, but thats just me. Also bone morphing is a common method to customize a model, the two together is ideal, and even more fun to implement. >_<

far as changing the model, yes and no, effectively what your talking about doing is selecting a model, destroying it, and replacing it with another prefab. Thats actually not nearly as hard…

with that said, I’m hoping to get our project playable in 8 more months, and we’ve been working on it for over a year, so expect it to take lots and lots of time. Accept this as a truth, and you’ll be allright. :wink:

As much as I respect Joe’s opinion about starting with simpler games, on the other end, the time you spent making that game could have yielded progress on your dream, but what he suggests would definitely see a released game a hella sooner =p

As far as the endless subclasses, know thats what your suggesting. A subclass for EVERY type of person place or thing is going to be painful, I’m not telling you not to, I’m just letting you know, it WILL be painful.

In conclusion, as far as the ‘how’, you have to try first. There are a ton of tutorials, and assets to help, and an amazing amount is free to help you learn your new craft. Once you’ve written a script, searched for why it didn’t work, and get stuck, post that script on here, and you’ll find quite a few who will do everything they can to help you figure out where you went wrong. But you still have to try first :wink:

Don’t forget the code tag when you post code, it not only helps make it readable, but some people will get annoyed and either complain, or ignore your post in response. >_<

Best of luck!

P.S. - omg, was he right about the wall of text, I didn’t even read every line, just scanned as much as possible…lol.