How to find rays in unity? How to script specific parts of a model?

I’ve recently been trying to learn how to work with ray tracing and procedural animation within Unity, but I can’t seem to find exactly what I’m looking for(though it may be very simple).

If anyone has any resources on rays within unity, I’d love to read them.

As for my second question, It’s less about procedural animation and more about how I can manipulate objects within unity, in order to implement procedural animation. I’m having trouble figuring out how I can manipulate how a model changes.

For example, let’s say I have a tree that I want to bend as I change a windDirection variable? or perhaps I want to manipulate the position of each leg of an animal?
Would I need a character rig or two different models for the legs and the pelvis?

Thanks in advance for any insight.

Dylan

Procedural stuff is great fun in Unity. Animation is kind of an advanced topic though. If you already have a rigged object with a SkinnedMeshRenderer and Animator/Animations set up, you can drive the bones directly in code and the skinner should do the trick, I think with an extra call to .Sample() or something on the animator.

If you want to set up the bones/mesh yourself, that’s a bit of a lift, but there are tutorials out there.

If you just want to recreate and modify mesh geometry at runtime, that’s the most straightforward way, and obviously the first step is to just create the geometry. I have a little project called makegeo that has a bunch of procedural geometry creation examples.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

Google around for more examples… here’s a discussion page with some goodies:

1 Like

Do you mean raycasting? It’s very different from raytracing (and generally, raycasting is more key to game dev than raycasting, unless you’re specifically a graphics programmer). I’m guessing this is what you meant, as raytracing is far removed from anything else you ask about.

If you don’t have specific questions on how a thing works and just want an overview, then just google the thing. There’s tons of stuff out there and we’re not going to retype it on the forums. “Unity raycast tutorial” is a good thing to google for, for example.

If you do have a specific purpose in mind, then you’ll get better answers by telling us what you’re trying to accomplish.

Yes indeed, that’s probably why i was having trouble finding info on it, thanks!