Forum rules - please read before posting.

Using draggable tracks as sliders to adjust object movement and adjust post-processing focus

Hi there,

I'm creating a puzzle where you can manually zoom in & out on images, and then focus on them manually using a screen.

My current implementation uses two draggable sliders (world-space draggable objects). One triggers the image objects to move/zoom and the other adjusts the focus. I've done this as they are meant to be physical knobs/sliders to adjust rather than UI overlays. As the sliders move, I trigger actionlists at key points along the track to set new positions of the images (move closer/further away). The focus works in a similar way (I play a post-processing animation that sets a new focus distance).

This method is very stuttery & I would like to smoothly adjust the movement like a UI slider could move an object. This probably needs to be done with some separate scripting running when dragging the slider to smoothly adjust zoom & focus, but I'm unsure how to keep adventure creator updated with whether or not the images are in focus (variable).

What are some methods to attempt this, or should I start from scratch with unity UI scripting instead?

Using latest AC & Unity 2022.

Thanks
Max

Comments

  • For a smooth change in some value when moving a Draggable along a track, you can have a custom script read its GetPositionAlong value, which returns its normalized position along the track.

  • Thanks - would this easily be able to set a ac variable in script as well? (Eg at 0.5 set correct distance?) As I need ac to also know the distance for puzzle reasons.

    Or just trigger an event within the script when it’s the correct track pos?

    Just checking where it’s better to just use an action list.
  • AC Variables can be set through script, yes - see the Manual's "Variable scripting" chapter, as well as the front page of the Scripting Guide, for details.

    You might also want to look into Snap Regions, a way of defining points on a Track that let you run ActionLists when a Draggable reaches them.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.