0
$\begingroup$

I want to create a simple 'falloff' effect for when a specific objects gets closed to each of the objects found in a collection.
I was able to get the visual effect I wanted, however, I am unable to make this 'localized' to each of the objects in the collection. Instead it does it for all of them when I get close enough to any of the objects.

This is my current code: enter image description here

Here is what it currently does:
Video of Shared Falloff (Imgur)

Is there any way to grab and iterate over the positions of each individual object in the collection?

$\endgroup$

2 Answers 2

3
$\begingroup$

I've understood from your question that you want a proximity (and falloff) based on the distance between the object and each element in the deforming collection.

Meaning this distance is constant for each deforming object.

enter image description here

So you can capture this distance before realizing,

then transmit it to the ray cast, so that it is now available in the grid context.

Example:

enter image description here

(Blender 4.0)

$\endgroup$
5
  • $\begingroup$ Well, yes that is what I am trying to do but, instead of getting the distance between the floor/grid and the Modifying collection I want to get the distance between the character object and the Modifying collection objects. So I don't really understand how that would work without a condition after the Raycast that dictates is the 'object' you hit 1.) in the collection and 2.) in range of the player object. When I implemented your approach it seemingly had the same issue as in the original video, unless I missed something: imgur.com/a/k5TSzwT $\endgroup$
    – Neuffexx
    Feb 13 at 9:43
  • $\begingroup$ I'm not sure I've understood your comment. Added a gif to illustrate the behavior. $\endgroup$
    – lemon
    Feb 13 at 9:49
  • $\begingroup$ Interesting, alright I misunderstood your code. But in any case this doesn't work for me, and I found out why, because I have a collection inside of a collection, is it possible to access sub-collections from within one? Any ideas? imgur.com/a/BHEdk1e $\endgroup$
    – Neuffexx
    Feb 13 at 10:18
  • 1
    $\begingroup$ The subcollection is seen as one instance. I dont think this is possible to separate it having only the main collection has input. And this subcollection position should be the origin. $\endgroup$
    – lemon
    Feb 13 at 10:27
  • $\begingroup$ Interesting, that is a shame but a constraint I can work with, thanks for the help! $\endgroup$
    – Neuffexx
    Feb 13 at 10:32
1
$\begingroup$

Geometry proximity is useless in this case, you need just calculate a distance between your "Character" object (in my screenshot is just empty) and the position of each face. Vector Math do this task easily:

enter image description here

$\endgroup$
1
  • $\begingroup$ Interesting, so there isn't any way to differentiate between the objects inside a collection? In a programmatic way that lets you go over each and every one of them like a for-loop? $\endgroup$
    – Neuffexx
    Feb 12 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .