Boundaries on TransformGesture translation

Ask for help and post bugs.

Boundaries on TransformGesture translation

Postby archer3cl » Sun Oct 15, 2017 12:20 am

I need to limit the space where my GameObject can translate using the TransformGesture translation.
My problem is whenever i try to clamp the position of my GO, the code appears to do nothing.

What im trying right now is to add an Event Handler to myTransformGesture.Transformed and then change my GO position.

Code: Select all
private void OnEnable() {
            _transformGesture = GetComponent<TransformGesture>();
            _transformGesture.Transformed += UpdateMovementHandler;
        }

private void UpdateMovementHandler(object sender, System.EventArgs e){
      transfrom.position = Vector3.zero; //This is not working. With or without my boundaries validation i cant modify my GO position
}
archer3cl
 
Posts: 3
Joined: Fri Aug 25, 2017 11:05 pm

Re: Boundaries on TransformGesture translation

Postby valyard » Tue Oct 24, 2017 11:45 am

The position is probably overwritten by Transformer component. You will need to modify the component itself.
valyard
Site Admin
 
Posts: 433
Joined: Mon Sep 08, 2014 11:57 pm


Return to Help and Bugs

Who is online

Users browsing this forum: No registered users and 1 guest