Why when I move the transform closer to the target by dragging it in the editor in the scene view the target start stuttering and moving back?

The script is attached to a transform that move to a target and than when reaching the target the transform become child of the target.

The script is working fine as it is now but if I drag with the mouse in the editor in the scene view the target to the moving transform while the transform is already moving to the target then the transform start stuttering and even moving back a bit like pushed back some forces pushing it back maybe because I’m using lerp in lines 55,56 ? I want to use lerp but maybe it’s making the problem?

Second if I move the target away from the transform instead trying to chase me and reaching me its doing this problems again.

I want that if I’m dragging and make the target closer to the moving transform than just keep the transform moving to the target and become child when they reaching each other and if I drag the target away from the transform make the transform try to chase me reach me and become child too.

using System.Collections; using System.Collections.Generic; using UnityEngine;  public class MoveToTarget : MonoBehaviour {     public enum TransitionState     {         None,         MovingTowards,         Transferring     }      public Transform destinationTransform;     public float speed;     public float lerpTime;     public bool isChild = false;      public AnimationCurve curve = AnimationCurve.EaseInOut(0.0f, 0.0f, 1.0f, 1.0f);     public Transform start;     public Transform end;     public float duration = 10.0f;     private float t;      private Transform originTransform;     private float timer;     private TransitionState state = TransitionState.MovingTowards;     private Vector3 originTrans;      void Start()     {         t = 0.0f;          curve.postWrapMode = WrapMode.PingPong;         originTrans = transform.position;     }      void Update()     {         switch (state)         {             case TransitionState.MovingTowards:                 var v = destinationTransform.position - transform.position;                 if (v.magnitude < 0.001f)                 {                     state = TransitionState.Transferring;                     originTransform = destinationTransform;                     timer = 0;                     return;                 }                 Vector3 moveDir = v.normalized;                 //transform.position += moveDir * speed * Time.deltaTime;                 t += Time.deltaTime;                 float s = t / duration;                 transform.position = Vector3.Lerp(originTrans,                     destinationTransform.position, curve.Evaluate(s));                 break;              case TransitionState.Transferring:                 timer += Time.deltaTime;                 this.transform.position = Vector3.Lerp(originTransform.position, destinationTransform.position, timer);                 if (timer >= 1.0f)                 {                     this.transform.parent = destinationTransform;                     isChild = true;                     state = TransitionState.None;                     this.enabled = false;                     return;                 }                 break;              default:                 this.enabled = false;                 return;         }     } } 

Holding and dragging mouse to select multiple buttons/cells

Is it possible to create a TogglerBar-type object in which several buttons can be selected/deselected simply by holding the mouse’s left-click button and dragging it over the buttons? Similarly to the multiple selecting option when holding control and the mouse on Windows, but without the drawing box.

It seems that, by default, TogglerBar only selects a button when the left-click button is released, but I’m unaware of any way of doing what I want. Any ideas?

Just to give some context. I’m working with cell dynamics, and I intend to make it easier to select a large group of cells in an epithelium. This is, in some sense, a follow up to a question I made before regarding a “toggleable” Voronoi Mesh.

Can a character or monster move a grappled enemy to another space in its reach without dragging them?

The rules on “Grappling”, specifically the “Moving a Grappled Target” section of the PHB (page 195) reads:

When you move, you can drag or carry the grappled creature with you, but your speed is halved, unless the creature is two or more sizes smaller than you

I wondered if monsters like the death kiss (VGM page 124), that can grapple creatures within a large reach (in this case, 15 feet) can move a grappled creature from a space in its reach to another space in its reach, without dragging it. Is this possible?

Trackpad’s accessibility setting Enable Dragging gets randomly tuned off

I enable System Preferences → Accessibility Mouse & Trackpad → Trackpad Options… Enable dragging. However, it gets unchecked (disabled) on its own. It happens after a few hours, as I face this issue at least once a day.

enter image description here

Does anyone know the cause or the solution? I’m using 13″ 2015 MacBook Pro running macOS Mojave 10.14.5. Nothing else is installed that can muddle the Trackpad settings.

How can I isolate data when dragging a field onto an InfoPath form from a User Information List Data Connection?

I managed to create a Data Connection in InfoPath with hopes to retrieve the current user’s information, display name, etc. However, when ever I drag the desired field over on to the InfoPath form, it creates a Repeating Section which includes all entries for that field. How do I isolate the information to be just for the current user?

Alternatives to dragging formula down?

I’m having trouble applying the following formulas to entire columns in Google Sheets. I think that an array is the best option because there are 5000+ rows, but any help is appreciated. I’m really stuck.

  1. =(IF (K2<>"", K2, IF(Q2<>"", Q2, IF(T2<>"", T2, IF (W2<>"", W2, W2)))))

    I tried: =ARRAYFORMULA(IF (K2<>"", K2, IF(Q2<>"", Q2, IF(T2<>"", T2, IF (W2<>"", W2, W2)))))

  2. =(IF(A2=A1,C1+1,1))

    I tried: =ArrayFormula(IF(A2=A1,C1+1,1))

  3. =if(C2="2019-January", "NEW")

  4. =VLOOKUP(E2, $ AA$ 2:$ AA$ 13,1, false)

Frame independent camera dragging

I am trying to implement camera dragging functionality and smooth camera sliding that happens when player releases mouse button. My code works, but the problem is that I can’t figure it out how to make it frame independent. At 60fps it works great but at unlocked frame rate camera does not move at all.

private MouseInput mouse;         private Vector2 mouseDelta;         private Vector2 lastMousePosition;         private bool enableMouseDragging;         private void UpdateMouse(GameTime gameTime)         {             if (mouse.IsDown(MouseButton.Middle) && !enableMouseDragging)                 enableMouseDragging = true;             else if (!mouse.IsDown(MouseButton.Middle) && enableMouseDragging)                 enableMouseDragging = false;              if (enableMouseDragging)             {                 var delta = lastMousePosition - mouse.Position;                 Position += delta;                  if (delta != Vector2.Zero)                     mouseDelta = delta;             }             else             {                 if (mouseDelta != Vector2.Zero)                 {                     Debug.WriteLine(mouseDelta);                     Position += mouseDelta * (float)gameTime.TotalGameTime.TotalSeconds;                     mouseDelta = Vector2.LerpPrecise(mouseDelta, new Vector2(0f, 0f), 0.08f * (float)gameTime.TotalGameTime.TotalSeconds);                 }             }              lastMousePosition = mouse.Position;         } 

Changing from x-y to x-z dimensions for dragging using the shift key- Input Latency problem

As a part of my project, I have developed a sphere that a user can move utilizing a mouse. Since dragging in Unity can only be done taking into account two dimensions at a time, I developed a mechanism to to change dragging on the x-y plane to dragging on the x-z plane, vice-versa. However, the program is definitely not user friendly, as it is difficult to control an object in 3D space when dragging on a 2D plane (IE: x-y plane or x-z plane). This matter is only made worse by the fact that there exists a severe input latency problem. Not every shift press to change planes seems to register, and often I must press shift multiple times just to change planes.

I have tried changing the location of the call to OnMouseDrag() to different places in the update() method. This did not work.

using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine;  [RequireComponent(typeof(MeshCollider))]  public class UserController : MonoBehaviour {   bool shiftOn = false;  void OnMouseDrag() {      if (Input.GetMouseButton(0))     {         if (shiftOn)         {             //3D Drag, courtesy of Unity Forums             float distance_to_screen = Camera.main.WorldToScreenPoint(gameObject.transform.position).z;             transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, distance_to_screen));         }          else         {             //Plane Drag             float distance_to_screen = Camera.main.WorldToScreenPoint(gameObject.transform.position).z;             Vector3 pos_move = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, distance_to_screen));             transform.position = new Vector3(pos_move.x, transform.position.y, pos_move.z);         }        }  }  void changeShift() {     shiftOn = !shiftOn; }  // Update is called once per frame void Update() {      if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))     {         changeShift();     }     OnMouseDrag();    }    } 

The input latency still exists. Shift calls often do not register, and I have to press it multiple times. I lose control of the sphere pretty easily while trying to switch dimensions.

How do I get rid of this input latency? Is there a better way of handling this? Is there a manner in which you can drag objects in 3D space with a mouse while controlling all three dimensions at once?

All responses are appreciated.

Thank you very much for reading, and I look forward to your suggestions.