Modelling a box open and closing.

Hello facepunch.

I’m curious to ask if someone could help me with the best method of making a custom box open and close for this I cannot animate with blender so I’m assuming the best way to go about this would be to make 2 models 1 box and the other box lid and then smoothly animate them with lua making them open and close.

Would this be a good or bad way of doing this?

If you don’t know how to animate then this is fine really. Actually easier in my opinon. Just know what you are doing when creating an ent. Don’t have it auto start the animation, have it in functions and checks.

Why not? It’s easy to animate something as simple as a box. Just create a bone for the box lid and a bone for the box bottom and google ‘animating in Blender’. It only took me a day to learn. It’s pretty much the same as SFM

Could even do some stencil magic.

Parent the model to the whole armature but parent the collision model to the root bone.

Add an armature modifier to the armature and don’t press apply (it’s just so you can see the movement)

Use Pose mode to move the bones and place location and rotation (LocRot) keyframes on the timeline.

You should be able to figure it out from there.

Make sure that on your collision model, each wall of the box is a separate cube that has been “set smooth” before joining them together with Ctrl-J. That way, when you set $convex it will know what’s hollow. Only thing you can’t animate is the collision model.

If the box is scripted and doesn’t physically contain anything, ignore the above part.

He doesn’t know how to use blender nor does he want to learn. Coding it is easy. All you need it two props. That’s it.

…or you can do it the proper way in blender and get it to look 10x better for 1/2 the time?

Sometimes it makes more sense to have bones, sometimes it makes more sense to code the door. I’ve opted to code the doors where it is a box-like object so that the collision models move with the door.

Not 1/2th the time because he would have to learn…

Or you could actually do it via Stencils which you rated me dumb for. Stencils would give you a way to alter an already existing model, to give it the perception of opening.

Look at work ARitz has done for examples. Or even at LinkTwilight.

Are you by chance confusing clip planes with stencils? stencils make no sense in this context, and honestly, I don’t think clip planes would look very good either.


One example. I’m friends with him on Steam, and it’s been done using Stencils (the opening part, the rest is a custom model).

I’m going with the assumption where since he doesn’t know how to model, stencils would be his next bet to get some sort of opening animation. This would, of course, not allow him to drop items in there like they were normal. But honestly you’d need a pretty big box for that.

[editline]8th December 2016[/editline]

Another example.


First of all, holy fuck those are both amazing.

However, they’re both opening out of the map. Specifically, out of a flat surface in the map. I don’t think this method would apply to a 3D prop/model which needs to open like a treasure chest (which is how I imagine OP wants it to look).

Off topic, I’d really like to know how he put the surface texture on the hatch. That’s not a stencil thing.

He grab it using renderview, for the textures I mean.

It’ll work on a prop as well too, you just need to do a little bit of finagling.

When all you’ve got is a hammer, everything looks like a nail. I really don’t think stencils are a sensible choice for this job.

[editline]8th December 2016[/editline]

Also, if he doesn’t know stencils he’d have to learn something new anyway. Might as well learn animations :wink:

Picking up modelling is definitely something I wish I had done. Still can, just a lot going on at the moment.

Maybe in the future, but definitely a strong skillset for the future OP, would recommend picking it up.

I don’t like you but this actually is pretty cool. Sorry for rating you dumb.

He is cute tho

I really do appreciate all of your feedback, much appreciated. I can model in blender and I am familiar with it and the UI itself, it’s just making bones and animating, then exporting the animation(s).

I’ve had a look at a few tutorials but they miss such things out.

Thanks for your help homies <£

I disagree

also -

just why