KatsBits Community

[Unity] Fantasy asset pack prefabs

0 Members and 1 Guest are viewing this topic.

Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've now got the rotating door code working in my door manager script. next i'll work on the sliding doors. which the manager will detect when needed.

in this image we have a script order of "trigger manager > lever manager > door manager" as well as each of them having their respective data scripts, for storing the start and updated variables in.

the order could also just be "trigger manager > door manager" as the lever scripts act as a relay, but are not required. the same principle would apply to buttons, when i've made them.



Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've got the sliding doors working. so that's the door manager finished for now, i think.

i also wrote a gizmos script for doors. which detects the door type, ie rotating or sliding, and draws either a little yellow pivot for rotating doors, or a sliding direction vector for sliding doors. the latter can move up, down, left, right, forward or backwards.

we can also enter into the inspector the door's move speed.




Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
these two images show the pairs of trigger volumes and levers for opening some doors.

note the 2nd image has unity's "scene window > gizmos menu > 3d icons" turned off. which makes it easier to see the gizmos we're working with in the foreground, but also clutters the screen with gizmos scripts attached to objects in the background. we can disable those objects and or their scripts if need be.






Online kat

  • Administrator
  • Hero Member
  • *
    • Posts: 2692
    • KatsBits
If you don't see comments in reply to these updates of yours just know that there isn't really much to add/comment on with these other than "good work", heh.


Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
understood. no problem my friend. i'm really enjoying producing content again. it's coming together quite smoothly, when my old laptop isn't playing up, he he.

of course, if you or anyone else has any questions about my work with your assets, feel free to ask. hopefully i can release my prefab package soon.


Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
here's a couple of wip images of the floor buttons, using kat's models and textures.

i slightly scaled up the width of the moving parts of the buttons. as i thought the original gaps looked a little too big. thankfully we can easily do this via the transform's scale property in the inspector. the prefabs i will be releasing will have this scaling already applied. so level designers can just drag and drop the prefabs into the scene, then adjust their height depending on how much they want the prefabs sunk into the floors.

i might make separate prefabs for wall buttons, with 90 degrees rotation and possibly scaling. the scripts i'm writing will detect which direction the moving part is likely to use, as well as display an inspector variable for the distance it travels when triggered.






Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i added in a feature to the lever gizmos, allowing the level designers to offset the little blue origin for connecting lines, in case it's obscured by the models.




Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've updated the door manager script so it can now open the doors away from the player, if the level designers want. it's not actually detecting which side of the door the player is on, it's based on which trigger volume or lever/button is used.

we can also set the amount of rotation for each door from -135 to +135 degrees relative to their start rotation.






Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages

these two images show unity's new prefab editing mode. which is very useful. although sometimes the models and or textures are too dark, as this mode doesn't use light objects by default. thankfully i realized we can copy and paste temporary lights into the prefabs.

i've used a couple of red directional (sun) lights as they help when i'm editing colliders, as shown in the 2nd image.

after we've finished editing the prefabs, we can delete the temporary lights.







Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've recently been experimenting with making some spawn/teleport textures. using the free image editor paint.net.

it's no where near as powerful as what kat uses, although it's ok for blending layers together and exporting jpg and png files. the sigils were copied from a free font called "inquit". that i downloaded from fontm.com. i'll be including my textures, unity materials and prefabs in my unity package for use with kat's assets, when it's ready.










Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
i've been doing some performance tests with the prefab spawners and their light objects.

considering i'm still using an old low end laptop, the performance of unity's standard material shader, using both alpha and additive blending seems pretty decent.

1st image has no light objects, only ambient lighting in the room. this is the fastest out of the 3 tests.

2nd image has a light object for each spawner decal. resulting in a lot of overlapping lights, which heavily impacts performance.

3rd has only 4 light objects, none of which overlap, and frame rate is good.








Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
these 2 images show some place holder cogs, built in unity not blender, being animated by my new rotating manager script.

the two small cogs are intersecting in a realistic way, i think. despite having mesh colliders, and rotating in opposite directions. normally prefabs with colliders don't intersect, unless we want them to.

i also added in a toggle for the levers and buttons so they can reverse the direction of the cogs. in the 2nd image one lever does that, the other lever turns the rotation on and off.

we can use them to build certain machines, and the cogs can be any size we want.

it took me about 3 days of research and trial and error to figure out how to rotate the cogs at arbitrary angles, like the large cog. the smaller cogs facing upwards were relatively easy.

now i have the code for all that we can rotate most things we'd want.






Offline ratty redemption

  • VIP
  • Hero Member
  • *
    • Posts: 1031
    • ratty's deviantart pages
just text in this update, it's also more related to scripting...

while testing my floor button scripts, which use the "auto activation" option from the trigger manager, as opposed to "manual activation" like levers use, i manged to break several times the double doors which were connected from the floor buttons.

they would become out of sync, so one half would be open and the other closed. i suspected this was due to the trigger manger having an "auto update" speed, where it switches between fast and slow updates, to save on cpu. problem is it's apparently unreliable.

so i'm removed the slow and auto update speeds and am now only using fast. it made the manager less complicated, which is good, but it currently means all triggers in a scene would be checked every physics frame.

i might write some system in the future, which enables and disables
triggers depending on the area the player or npc's are in, so giving the trigger manager less work to do.