Scale Object by Looking at them? (Gaze Interaction)

Hi there,

I am trying to develop a demo where the longer you look at an object, the larger it gets.

I am a novice and would love to be pointed in the right direction.

I’m thinking the logic would be along the lines of - for each second/half second the ray is colliding, scale the localscale of the object x amount.

Can anyone help frame this a bit better?

Thank you for any help - much appreciated!

Using some gaze input system like Google VR or my VR Interaction pack, setup an OnPointerEnter on the Event Trigger, and write a custom script with a function to be called OnPointerEnter. The script should have an Update() function and a custom function like: void OnPointerEnter(). At the beginning of the script, define a bool gazedAt = false. In OnPointerEnter function, set bool gazedAt to true (PointerExit gazeAt = false). In the Update() function, if gazedAt = true, transform.scale += 0.1f * time.deltatime

1 Like

Wonderful! Thank you! I am actually going to grab your asset as it looks PERFECT for the use case.

A slight adaptation to my normal question - what about changing the color of a render material on a gradient.

I’m exploring using animation to accomplish this, but I don’t understand how to hold the animation in the middle of it’s play when not gazed at, then pick back up along the same spectrum. I know Color.Lerp is a bit limiting, suggestions?

Basically trying to create a VR heatmap, placing areas around the scene to gauge where people look the most.

Thanks mate! The gradient effect sounds more like a custom shader (search gradient shaders on asset store). Some possible solutions are Unity Analytics heatmaps:

Or maybe this free heatmap solution:

Absolutely! Playing around with it now!

We unfortunately only use Unity Plus so the built in heatmaps are a no-go.

Killer utility, but It’s less about position, and more about Gaze. Specifically interested in what they are looking at.

As I create this little demo, do you have a good contact e-mail if I run into any issues with the asset/integration?

Yes, check the pdf documentation file in any of my packs for the email address. I’m also pretty responsive on YouTube but sometimes it’s hard to keep up.