- Home /
How to make player change into werewolf (script)
Hello,
I am new to programming, and am currently working on a game where the character is a werewolf. The only problem is, I have no idea how to even start the script to allow the human character to turn into a werewolf with his own set of health, stats (speed, abilities, etc.,)...
I have looked all over the forums and googled thousands of sites to find something similiar (change into an animal, transform player characters, different combinatins) but to no avail.
Would anyone be kind enough to help explain to me a basic script (preferably Java since I am more familiar with it than C#) to help get me started? Or even just a helpful hand to point me in the right direction would be greatly appreciated.
What im looking for specifically is how to play animation (for shapeshifting), change player model from A to B, and a basic function Update (increase health 80%/disable abilities/enable abilities) when player is transformed.
Thank you all for taking the time to read this, and I hope someone can help me out or point me to a good source to get started.
Answer by thingimibob · Nov 26, 2013 at 08:00 AM
This is a similar thing to what i'm looking for and there isn't really a lot of questions like this, if you know a bit about scripting i recommend adding to your character script, for example adding stuff like "when (e) is pressed change to gameobject.(whatever your gameobject is called) <--- this won't work but it is an example for something you would have to do. As for making changes to health and stuff you would already have a health script (hopefully) so all you would need to do is add the health to your other player but changing it for example health=200 hits of gameobject bullet
you would change it to health=500 hits of gameobject bullet
(this won't work either but it is an example of a health script), you would just copy and paste the script into your second player and then change it.
Hopefully this helps you (although I didn't give a written script), hope you find your answer.
:)
Thank you for your reply, but it doesnt really help me much...
Answer by haim96 · Nov 26, 2013 at 08:58 AM
well, there are two way to solve this:
A. when the player change you replace the player game object.
B. when the player change your player game object morph (shape shift) from one form to other.
option A is much easier to achieve. i would put the two player gameobjects under one root player controller and set to active the one i need.
for option B you should take in consideration the shape shifting in the modeling stage and this make things a bit more complex. but the results should be nicer. here a link to plugin that can handle morphing in unity: http://www.west-racing.com/mf/?page_id=257 didn't test it myself... i'm not sure if and how unity handle morphing target without plugin...
and of course, you need to learn everything you can about Unity animation system. lots of videos and script sample here: http://unity3d.com/learn/tutorials/projects/stealth
Thank you for the reply.
im assu$$anonymous$$g for the morph to work I would probably need Unity Pro. i know some things dont work with basic Unity (like motion blur).
also, if i changed the game object to just look like the werewolf ins$$anonymous$$d of the human, how would i de-activate the script for human character and enable the script for werewolf character? seeing how they would have different abilities and slightly different controls, im assu$$anonymous$$g i would have to make a series of 2 seperate scripts for each character.
Thank you for your help. :)
if the script attached to the game object and you de-activate the game object the script de-activated as well.
there appears to be an issue with disabling game objects with children. All I get are errors.
Answer by Will-D-Ramsey · Apr 19, 2017 at 09:29 PM
Let me know if you still need help. Im just looking for tip on the subject but I was going to go with an object swapping solution as Haim98 suggested. This is a pretty simple trick that not only work but helps the thought process of game development in general. Smoke and mirrors.
Answer by ardenbelfry · Sep 21, 2018 at 01:17 PM
looking for something similar, found this https://www.youtube.com/watch?v=vD5pW97-050
Your answer
Follow this Question
Related Questions
Changing GameObject texture? 4 Answers
Digital clock 1 Answer
script help gameobject to playercar 1 Answer