• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Unity Tutorial for Traps, Electrical, and Workstations

Sorrowthief

New member
I would love to see an up to date tutorial on the creation of custom traps and workstations. A few of the things I am finding confusing and that I would love to be included in such a tutorial would be an explanation on colliders. How does 7 days handle colliders? I have went through many of the tutorials offered here and I don't recall any of them adding colliders to their new items.

I would also love for this tutorial to cover how to create a trap that uses the same electrical system that is in game now but using your own custom models. With that, how do you best recommend adding new models that don't closely match an exsisting block in the game. What I mean by that is a lot of these videos use another object in 7 days that looks similar to what the user is creating and they match it up as close as possible. What do you do when the new trap/Block is a way different shape and doesnt really match up to any base game objects very well. With the trap part I would like to know what to do when you have an assett from the Unity store that comes with it's own animation. I have a trap that has a rotating animation and I did get this model working in game well but it just spins non stop. Would you be able to please explain the steps to tie this in with an electrical system in 7 days so the trap turns on and off like they should. Finally when you have an animation like I described with many different moving parts, how do you make the new trap do damage from a specific point. Like with the hammer I tried adding a collider to the hammer part of my prefab but did not understand how to make that specific part do damage to zombies. It would be awesome to watch and learn all of these things and if anyone does make these thank you in advance.

If some of this has been covered in other videos please point me to the correct links that are still usable in A17. Thanks a lot for all that you people do to help us older dumb people try and learn this stuff. You guys amaze me with how smart you are.

 
My guess is that you would have to write a script with void OnCollisionEnter to start the animation and another one for OnCollisionExit to stop the animation. Then set the collider radius to determine how far out the animation will activate.
https://docs.unity3d.com/ScriptReference/Collider.OnCollisionEnter.html

https://docs.unity3d.com/ScriptReference/Collider.OnCollisionExit.html
Yeah thanks for that. I have done a decent amount of modding in Unity when my son was in college for game design but he was the coder and I mainly just made models in blender for him so the scripting stuff is not a strong point for me. I guess I just have not seen any information that I can find to see how people are doing this and the electrical part I believe is above what I can figure out by tinkering around. I know it's a huge request but I hope someone decides to make a video explaining these things in depth for people like me. Sadly my son has better things to do these days then help poor old dad figure out a script. I have to wait days before I even get a phone call back lol. College young life, is what it is lol.

 
No Problem. If you are interested in learning more about C# and writing code for Unity, Unity has some good tutorials as well as Udemy and youtube. This is all new for me as well I just tried writing my first script for the game which works in unity but i can't seem to get it into the game. I am starting to think that SDX hasn't been updated for A17 yet. Whenever I run the game I am getting an error in the debug menu that the class being referenced in my xml file isn't in the assembly files. so either SDX isn't writing to the Mods.dll or Mods.dll isn't being injected into the assembly-Csharp.dll. It has been very frustrating to say the least.

 
No Problem. If you are interested in learning more about C# and writing code for Unity, Unity has some good tutorials as well as Udemy and youtube. This is all new for me as well I just tried writing my first script for the game which works in unity but i can't seem to get it into the game. I am starting to think that SDX hasn't been updated for A17 yet. Whenever I run the game I am getting an error in the debug menu that the class being referenced in my xml file isn't in the assembly files. so either SDX isn't writing to the Mods.dll or Mods.dll isn't being injected into the assembly-Csharp.dll. It has been very frustrating to say the least.
Yeah I definitely feel your pain bud. I got my prefab in game, it spins, and I was able to get the colliders on it so it now pushes my player back on contact. Still at a lose on how to make it utilize the electrical system or do damage period. I'm almost certain that I may need to add my trap to some script because when I just replaced their model with my prefab I get a NRE telling the prefab doesn't exsist in entities/electrical. I should probably just stick to simpler things like new items and things without animations until I learn more or there is more Information on how to transition these things. Like they say though you don't learn unless you F up right? Hopefully someone will share some knowledge on these tricker things at some point. For now just know that there is another guy way over here in NC banging his head on the keyboard too lol. I have been reading alot of those tutorials but all my stuff works fine in Unity, I think I need more knowledge and know how about how to transition it all to work with 7 days. Good luck to you bud.

 
Back
Top