Reference objects in custom behaviors/extensions [SOLVED]

Hello, I recently started using custom behaviors and it has made development much easier.
However, I could not find information anywhere on how to use objects/groups from the project in them?

I tried making all of my objects/groups global, but they dont appear in the behavior groups.
Let’s say I want to use raycast against a certain object that already exists for all of the game scenes, is that even possible?

:smile: Sorry for the huge wall of text, but I will explain the situation in detail, perhaps it will be important for undestanding:

I’m making a 1st person game. I use two 3DRaycasts -
1st to detect a point in the center of the screen (hitscan shooting, displaying the names of objects and characters when looking at them, etc.)
2nd raycast goes from the character’s feet down to determine the Z coordinate of the “floor” at which he should fall if he is above it and is not in a jumping state.
(I use 3DRaycast in this case because it allows you to create realistic ground meshes with any sorts of hills, bumps, inclined surfaces, etc. and move around them accordingly, just like in Skyrim, Fallout, etc. Really cool feature.)

Here’s the problem: when using more than one 3D Raycast, they begin to conflict with each other, the intersection coordinate of one Raycast is replaced by another and vice versa, they cannot be obtained separately.
As far as I understand, custom behavior allows you to create events that will be executed separately before the scene events. I thought about separating the raycasts and events associated with each of them in this way.


UPD: I solved the problem with 3DRaycast, I’m not really sure how, it seems that there was something wrong in the event structure.

But nevertheless, the question of the possibility of using objects and groups from the project in custom behaviors remains relevant.

You have to create a new param object, but you can’t do it from a “doStepPreEvents”
You should use a Action function and add an object parameter there

1 Like

Thanks a lot!

I regret not trying to use them sooner, this is absolutely essential on a bigger project.