Is there any way to call a raycast selected object when doing events so i can change the
Explosion Center: LetterRayX, LetterRayY
Shown in the image, to
Explosion Center: RaycastSelected.CenterX(), RaycastSelected.CenterY()
Or is that not possible in a simple manner?
If a raycast detects an instance of the object that it was cast against then the object gets picked. Any other conditions, expressions or actions are apply to that instance. That applies to anything in the event and any subevents.
If you wanted to sort of remember which object was detected for longer than the event then you could set an object variable and then later repick the object by using a condition that looks for that value or boolean state. Revert the object variable to false or whatever when you no longer need to reference it.
1 Like
the issue here is that i am using separate objects so what i’m trying to do is specifically to call/save the specific object that was picked
also would there be any way to add multiple objects to a group so all can be called simultaneously with one action
In your screenshot it’s testing a ray against Bumper. If it detects an object, it will pick that object. It will only pick 1 object. You could use the object variable technique and change an object variable like Selected to true. If it further detects objects then it could set them to true as well. Not at the same time but in other events or frames.
Now, you could check if the object variable was false before casting a ray and then it could ignore the picked object and pick other objects.
You could then check if the object or group variable is true and then repick them. You could then use them for whatever. You might need to use for each object as a subevent if each object needs to be reference for say its location or other instance specific value.
Instead of an object variable. You could link and unlink the detected object although it would be tougher to ignore the linked objects. As I discussed earlier.
2 Likes