Download gives errors and doesnt run
The screenshots only show warnings, those shouldnāt stop the project from working (but thanks for reporting them, we should try to remove those in the next release).
If you press play in the state the editor is in that screenshot, nothing will happen as the scene is empty. The 1st tutorial will guide you to open the right scene to test the game (part 7 here : https://learn.unity.com/tutorial/get-started-with-creator-kit-beginner-code?projectId=5d48025dedbc2a0020e85be2#5d4c222fedbc2a00219044fa )
Gamepad support would be awesome with this.
Iām trying to find out how āAttackEventā and āFootstepEventā in AnimationControllerDispatcher. I tried adding my own enemy, but it does not get these triggeredā¦ I have been checking it up and down to match the game object or if itās in the animation controller, simply canāt find references for āFootstepā anywere. Please help
Oh whoops, I found it by using Total Commander search, itās baked into the animation
Example from: CactusBossy_Walk
I really liked it, but i want to enlarge the map. i tried to remove some grass and paint the sand on it but i canāt walk there?
How can i walk on that terrain?
Hey there. So Iām totally new to this and trying to get through this kit. Iāve encountered an issue Iām having a heck of a time resolving.
In part 10, the create parameters for the constructor portion, step 4 says to go change
LootAngle myLootAngle = new LootAngle();
to
LootAngle myLootAngle = new LootAngle(15);
Then immediately on part 11 it seems to indicate changing that to
LootAngle spawnAngle = new LootAngle(45);
Is that what itās saying to, or am I supposed to be adding this in addition to the existing one?
Here is what my start function looks like based on the steps in the tutorial.
void Start();
LootAngle myLootAngle = new LootAngle(15);
LootAngle spawnAngle = new LootAngle(45);
//every call will advance the angle!
potionSpawn(spawnAngle.NextAngle());
potionSpawn(spawnAngle.NextAngle());
potionSpawn(spawnAngle.NextAngle());
potionSpawn(spawnAngle.NextAngle());
It feels wrong and has several errors I donāt quite understand. Any insight would be great.
Personally, at the end of this part it would be nice to see the full script as it should look so I know where I made my mistakes.
Thanks!
Discovered my problem! The wording of one of the steps seemed to have me put the following outside of the SpawnerSample class.
void SpawnPotion(int angle)
{
int radius = 5;
Vector3 direction = Quaternion.Euler(0, angle, 0) * Vector3.right;
Vector3 spawnPosition = transform.position + direction * radius;
Instantiate(ObjectToSpawn, spawnPosition, Quaternion.identity);
}
Move it move it into the class below the Start function and everything was better!
Thanks!
Iām working on expanding this using resources from Synty Studiosā Western and Western Frontier Packs, and animations from Explosiveās RPG Character Animation Pack.
As someone noted above, the Attack animation that is built in to the Tutorial uses an Animation Event to indicate when a hit has occurred, and this calls CharacterControl.AttackFrame().AttackFrame does several things, but probably the most important is that it sets the playerās stateback to Default. So without this, the CharacterControl.CheckAttack() function thinks weāre still attacking, so the player can never attack after the first one!
To deal with this, we can add an Animation Event called AttackEvent to our animations, BUTthe RPG Pack actually comes to our rescue because EVERY attack has a Hit() Animation Event built in ANDtimed correctly!
So I just created a Hit() function here, and then copied the body of the AttackEvent() function!
The Run animation that the Tutorial uses also relies on an Animation Event to kick up dust as you run along, but AGAIN the RPG Animation pack saves our bacon, with the FootL() and FootR() functions.This is actually arguably better, since you can (if you want) explicitly determine which foot is hitting the ground and exactly when! I didnāt do anything weird with the different feet here. I just copiedand pasted the body of FootstepEvent() into FootR() and FootL() functions, and it now correctly kicks up dust for my cowgirl!
NEAT!
So now a question: the SeethroughBlue shader has some really funky effects when applied to the Synty character models, most likely because there are some occluded triangles within the mesh, which causes the shader to kick in even when the character is standing out in the open. Is there any way to deal with that, or am I just more or less stuck with disabling it? Itās such a NICE effect, but it looks terrible if the model isnāt optimized.
Iāve also gotten a pistol to work nicely, but so far have not found a way to quickly switch weapons in game. Iām controlling my animations using a WeaponID parameter, which I suppose I should bake into the Weapon stats Scriptable Object, and add to a script, but I havenāt worked that out yet (at present I switch it manually in the Editor).
This is a REALLY good kit, with lots of great systems built in. I switched out the Mike Moose model for a cowgirl from the Western pack, and was pleasantly surprised when she appeared in my Inventory screen without me having to figure out how that was done!
Oh, if youāre going to switch out the main character for one of your own, youāll need to do a few things:
- Create an Animator Controller, since Mike Mooseās animations are specific to him. You can (and probably should!) copy his Animator Controller, and just swap out the animations, though.
- Copy every component from the Character object in the Example Scene onto an empty game object (mineās called Character_Player_Cowgirl)
- Make your character model the child of that empty game object
- Remember to assign an Animation Controller Dispatcher to your character model!
- Create an empty game object thatās a child of Character_Player_Cowgirl (or whatever you call yours) and rename it to CameraTarget
- Update GameplayVCAM (a Cinemachine Virtual Camera) to Follow and Lookat the new Camera Target object
- Update Managers->SFX Manager to make the Listener Target your new Camera Target
- Update Managers->UIRoot->GameUI to set the Character_Player_Cowgirl to be the new Player Character
There may be more, but so far everything is humming along swimmingly.
This thing is a lot of fun!!
Just calling AttackEvent() from inside your new Hit function should work the same and will allow you to have a single place (the AttackEvent function) to modify if you want to do modification to what happen on attack. Same for footstep event.
The seethrough need to be rendered before the character. Normally thatās the shader would do 2 rendering pass, the see through first, but shader graph donāt allow yet to do multi pass, so we have to rely on the renderer drawing meshes multiple time if it have more material than mesh. But that mean we need to order them properly.
If you look at the see through material, you will see that itās rendering queue is set to 2098 (Geometry+98), that is set through the shader, and if you look at MikeMoose material you will see itās queue is 2099 (Geometry+99) so that itās draw AFTER the see through one. Since the see through does not write into depth, the character rendering will āoverwriteā any blue it render on top of.
So make sure all your new character materials have that same queue set (can be set per material, donāt have to write a special shader for it).
Indeed, just add it to the Scriptableobject (you can even make it an enum WeaponStyle, like
public enum WeaponStyle
{
Melee = 0,
Pistol = 1
}
public WeaponStyle Style;
then Style will appear on in the weapon data inspector as a dropdown with a proper name, and you can send that as a parameter to your animator to choose the right blend tree (or even just switch between 2 animator controller if you use totally different animation for all stage) by casting in (int)Style to make it back into an integer id.
In a full game, I would even recomend using animation blending (so you can have a single leg animation for running, idle etcā¦) and just blend top body animation based on equiped weapon but that require a lot more change and we didnāt have the animation for it, but thatās a good āleft as an exercise to the readerā
Just calling AttackEvent() from inside your new Hit function should work the same and will allow you to have a single place (the AttackEvent function) to modify
Oh, thatās brilliant! Gah! Why donāt I think of these things??
So make sure all your new character materials have that same queue set (can be set per material, donāt have to write a special shader for it).
Hmmā¦ Iām using the LWRP Lit Shader, and that doesnāt appear to be one of the exposed settings (I am shader illiterate, so pardon me if Iām not using the right words here). I tried switching to the same shader that Mike uses (ShaderGraph/MainRimShaderGraph) and that does kind of work, but I did still get weird blue artifacts when the character is facing away from the camera. Then I realized that there was a setting called Rim Color in that shader, and setting that to black (and the Render Queue to 2099) seems to have resolved my issue!
Indeed, just add it to the Scriptableobject
Brilliant! Iāll let you know how it goes!
I think I found a typo. In CharacterData the Comment says āAgility reduce by 0.5% the cooldown to attack (e.g. if agility = 50, 25% faster to attack)ā
The code says:
If you take a weapon with a speed of 1, and use the example agility of 50, this results in a new modified cooldown of 0.975.
I think thereās just an extra zero in the second float. If we change that to 0.01f, the new modified cooldown (of a speed of 1 and an agility of 50) is 0.75, which is a 25% reduction, and matches the Comment.
As pointed out in the comments section in the tutorial, you canāt save the project by pressing Ctrl + S, or from File > Save Asā¦ Ctrl + S will save the scene, not the project. There should be a File > Save Project Asā¦, but there isnāt. The only way to save your own copy of the project is by quitting the editor and then selecting Keep.
This is very frustrating until you discover this. Like probably many other newcomers I spent quite some time until I discovered how to save my own copy of the project. Until you fix this is in the Unity editor, at least update the tutorial instructions which should be quick workaround.
Hi guys I am trying this days to use creator kit beginner code to make my character move attack and collect. At the beginning everything works fine until a few seconds later he starts to walk in the direction I want but facing the wrong way so he looks like he is sliding and everything starts to be a mess.Did anyone manage to make it work? Does it has anything to do with me using a plane as an example and not a terrain? Because even when I use mikeās avatar and animations to my character even if it isnāt animating everything is working good and he is walking correctly but not when I use my avatar and animations for some reason.
Iām pretty sure this is a problem with the lightweight render pipeline. Probably incompatibility with your OS or graphics driver. Facing the same problems using Ubuntu.
Changing terrain material doesnāt fix it for me. Had to disable lightweight pipeline (remove pipeline asset from Project Settings > Graphics) and assign the default terrain material to the terrain object. Sadly you have to reconfigure all materials to use Standard shader, as the shaders used seem to be incompatible with default pipeline. Have no solution for the outlines yet, and havenāt checked if all particles are compatible with standard particle shader.
Hard grind to get it working, of course look (and performance) differs a lot from intended version.
I hope the pipeline getās fixed for ānot windows usersā
edit: havenāt tried to fix the pipeline itself yet, maybe i will try that too
I was able to get it to work just fine using some low poly cowboy models from Synty, and the RPG Animation set from Explosive. I didnāt change the terrain, though, for my experiments, but I canāt think of how changing it to a plane would affect anything (assuming that the Navigation got baked for the plane, which it would have to since the player moves with a NavMeshAgent).
I didnāt have any problems seeing the terrain in the game (or with it being rotated).
After playing with it for a few days, I dropped this, but I did manage to implement shooting for both the player and the enemies. I got stuck when I tried to fiddle with the inventory, because I couldnāt figure out how to let the player choose between various weapons (by default, your regular weapon is replaced when you pick up a new one, and you canāt drop the one you have).
Still, I found the framework to be pretty flexible to a point.
I am making a game where you use abilities and new weapons but their use is time based so you have to use wisely your new weapons with better stats or the abilities or you will wait for the cooldown in order to collect a power up card to use so maybe you will find a way with a script and a philosophy of yours to make it to work since you do not have a way to discard by the kit.
One more question I downloaded the rpg animation pack what changes should I make to use the animations? Because I want to use a generic character to play generic animations instead of humanoid , like the character in the kit.
First, Iām using a humanoid rig. This makes retargeting animations work.
Generic animations are typically used for a specific model, so you canāt retarget them to a different model (unless they happen to have the exact same skeleton and rig).
Rig a humanoid character, copy the existing controller, and replace the animations with those from the rpg animation pack.
If I were you, Iād start with one of the simpler packs to learn the basics of character movement and controls (thereās one where you make a stealth game about a cat in a house that will get you up to speed).
Hello Professionals,
I started the Creator Kit: Beginner Code course after experimenting with unity software and got stuck in the last ācustomizationā class.
One of the tasks I was tasked with was to remove one unit from the inventory when the bool true was used.
And in the second task of this task if the playerās life is full the potion will not be used and no bool false will be removed.
What should I think of when writing variables and classes?
Nice tutorial, can you please give a example how you would add more āadvancedā status effects? For example some ideas what I mean:
- Damage Shield is added with a start value and everytime the character takes damage it reduces the damage until the shield is at zero and is removed or the duration is done
- Damage Spikes, everytime the character takes damage a part of the damage is returned to the attacker until the duration is done
My current idea would be to extend the StatSystem Damage method and add some events there for example OnDamage event and OnPostDamage event and pass the attack data as event args (similar to the weapon effects, but as events instead of direct method calls, so āanyā object can modify/observe the damage).
Then the status effects (or any other object, for example a quest system which wants to keep track of damage dealt or enemy killed etc) could add event handler and modify/observe the damage.
This this a valid/good solution or would you recommend a different solution for status effects which want to modify the damage?