Why it’s never switching cameras and not moving back to the original position the transform?

using System; using System.Collections; using System.Collections.Generic; using UnityEngine;  public class OpenningScene : MonoBehaviour {     [Header("Animators")]     public Animator[] animators;      [Space(5)]     [Header("Movement Settings")]     public Transform target;     public float movingSpeed = 1f;     public bool slowDown = false;      [Space(5)]     [Header("Rotation Settings")]     public float rotationSpeed;     public DepthOfField dephOfField;     public float waitingAnimation;     public float startConversation;      [Space(5)]     [Header("Cameras")]     public Camera[] cameras;      private Vector3 targetCenter;     private bool startWaitingAnim = true;     private bool endRot = false;     private int medea_m_arrebola_index;     private List<int> soldiers_indexs;     private Vector3 originalPosition;      // Use this for initialization     void Start()     {         originalPosition = transform.position;          targetCenter = target.GetComponent<Renderer>().bounds.center;         soldiers_indexs = new List<int>();          for (int i = 0; i < animators.Length; i++)         {             animators[i].SetFloat("Walking Speed", movingSpeed);              if(animators[i].name == "medea_m_arrebola")             {                 medea_m_arrebola_index = i;             }             else             {                 soldiers_indexs.Add(i);             }         }     }      // Update is called once per frame     void Update()     {         if (dephOfField.dephOfFieldFinished == true)         {             PlayConversations.PlaySingleConversation(0);             dephOfField.dephOfFieldFinished = false;         }          float distanceFromTarget = Vector3.Distance(animators[medea_m_arrebola_index].transform.position, target.position);          if (slowDown)         {             if (distanceFromTarget < 10)             {                 float speed = (distanceFromTarget / 10);                 for (int i = 0; i < animators.Length; i++)                 {                     animators[i].SetFloat("Walking Speed", speed);                 }             }         }          if (distanceFromTarget < 5f)         {             for (int i = 0; i < animators.Length; i++)             {                 animators[i].SetBool("Idle", true);                  if (startWaitingAnim == true)                 {                     StartCoroutine(WaitForAnimation());                     startWaitingAnim = false;                 }             }              if (waitinganimation == true)             {                 animators[medea_m_arrebola_index].SetBool("Magic Pack", true);                 waitinganimation = false;                  PlayConversations.PlaySingleConversation(1);             }              if(distanceFromTarget > 10 && BeginningCutsceneTrigger.entered == true)             {                 transform.position = originalPosition;                 cameras[0].enabled = false;                 cameras[1].enabled = true;             }              for (int i = 0; i < soldiers_indexs.Count; i++)             {                 animators[soldiers_indexs[i]].SetBool("Rifle Aiming Idle", true);                 if (!endRot)                 {                     Quaternion goalRotation = Quaternion.Euler(0f, 0f, 0f);                     float angleToGoal = Quaternion.Angle(                             goalRotation,                             animators[soldiers_indexs[i]].transform.localRotation);                     float angleThisFrame = Mathf.Min(angleToGoal, rotationSpeed * Time.deltaTime);                      int index = soldiers_indexs[i];                     animators[index].transform.Rotate(index % 2 == 0 ? Vector3.up : Vector3.down, angleThisFrame);                      // We end if we rotated the remaining amount.                     endRot = (angleThisFrame == angleToGoal);                 }             }         }     }      bool waitinganimation = false;     IEnumerator WaitForAnimation()     {         yield return new WaitForSeconds(waitingAnimation);          waitinganimation = true;     } } 

Maybe the reason is that the player is not in the view range of the other characters ? If I set it to be bigger then 3 it will switch the cameras but not move the transform to it’s original position.

And I want that when the distance is bigger then 10 and the other flag is true then change the transform position and switch the cameras but it’s not working.

This is how I trigger the flag and it’s working I checked with a break point :

using System.Collections; using System.Collections.Generic; using UnityEngine;  public class BeginningCutsceneTrigger : MonoBehaviour {     public static bool entered = false;      private void OnTriggerEnter(Collider other)     {         entered = true;     } } 

How to fix label position inside Manipulate?

I’m trying to make this manipulation. Initially, I use Text to add Happy Wedding. However, the function doesn’t allow me to format the font, color, etc. So I changed it and used PlotLabel. The problem is that the label position is moving with time. How can I fix its position on the top?

Manipulate[  If[n =!= nold, vHues = Table[rhue[0.2, -0.15], {n}];    mPositions = RandomReal[NormalDistribution[0, 1], {n, 2}];    vSizes = RandomReal[{0, 1}, {n}]; nold = n];     Graphics[{Thickness[t],     Table[{vHues[[i]], hea[mPositions[[i]]*s, vSizes[[i]]^e]}, {i, n}]},   PlotLabel ->     Style["Happy Wedding", 40, Hue[0.5/6], FontFamily -> "Mistral",      Background -> White],    ImageSize -> {350, 350}], {{s, 1, "separation"}, 0.1, 2,    ControlType -> Animator}, {{e, 0.5, "size variation"}, 0.05, 2,    ControlType -> Animator},    {{n, 10, "number"}, 1, 20, 1,    ControlType -> Animator}, {{t, 0.001, "thickness"}, 0.00001, 0.03,    ControlType -> Animator}, TrackedSymbols -> True,   ControllerLinking -> True,    Initialization :> {nold = 10,    hea[{x_, y_},       s_] := {BezierCurve[{{0, 0}, {1, 1 + RandomReal[]*0.3}, {0.5,           1.3 + RandomReal[]*0.3}, {0, 1}}],        BezierCurve[{{0, 0}, {-1, 1}, {-0.5 - (Plus[RandomReal[]])*0.3,           1.3}, {0, 1}}]} /.            {(x1_)?NumericQ, (y1_)?NumericQ} -> {x, y} + s*{x1, y1}}] 

Remove x last elements of an array and reinsert them before position y

I am looking for an algorithm to move a subarray in before an element (which is not part of that subarray) in the same array where the last element of the subarray is the last element of the array with O(1) extra space and O(n) runtime.

e.g. where *p1 = 5 and *p2 = 3:

1 2 5 6 7 3 4


1 2 3 4 5 6 7

This is what I have so far (written in C programming language). Trouble arises when p1 reaches p2.

void swap(long* p1, long* p2, long* array_end) {   long* p2_i = p2;   while (p1 < array_end) {     if (p2_i > array_end) {       p2_i = p2;     }      // swap *p1 and *p2_i     long* temp = p1;     *p1 = *p2_i;     *p2_i = temp;      ++p1;     ++p2_i;   } } 

Accelerated and average position

I've been experimenting with the new AI on adwords. My website is for lead gen. I've tried Max. Conversions and CPA, and had some success.
I'm was hoping someone here would know of the newest course that might be out there. I want to learn how to use audiences, and demographics in my campaign.

Can someone point me in the right direction?

ERROR: gcloud crashed (UnicodeDecodeError): ‘utf8’ codec can’t decode byte 0xc8 in position 145: invalid continuation byte

I have installed SDK and try to do gcloud init but i am getting below error.

can anyone please help on this.

khumansingh@DESKTOP-97PCNCB:~$ gcloud init Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag: gcloud init –skip-diagnostics

Network diagnostic detects and fixes local network connection issues. Checking network connection…done. Reachability Check passed. Network diagnostic passed (1/1 checks passed).

ERROR: gcloud crashed (UnicodeDecodeError): ‘utf8’ codec can’t decode byte 0xc8 in position 145: invalid continuation byte

If you would like to report this issue, please run the following command: gcloud feedback

To check gcloud for common problems, please run the following command: gcloud info –run-diagnostics

How to sort file from one position to another in Nano Text editor

am very new to ubuntu, i was using windows now am using ubuntu server. i have web application i need to set up and some of the instruction instruct me to open DIRECT.CONFIG file in nano text editor, i was able to open the file and when i open the file it opens with this file ordering

directoryindex index.html index.cgi index.pl index.php index.xhtml index.htm

now i want to move the index.php file above to the first position after the Directoryindex, so just after DIRECTORYINDEX it must be followed by index.php like this:

directoryindex index.php index.html index.cgi index.pl index.xhtml index.htm

what should i do if its shortcuts or whatever because in below of NANO editor i just see the shortcuts for replace, justify, cut etc. any help will be appreciated.

Calcluate Mesh top, bottom, left and right position relative to mouse click position on the mesh

I have a mesh (suppose it can be circle, or rectangular,square or an arc). The geometry of the mesh can be anything. I can click on mesh at any position. From relative to the clicked position, I want to get its right, left top and bottom position of the mesh. Maybe the picture explain it better then my words enter image description here

ImageMagick Crop image keeping original position

Having enter image description here https://upload.wikimedia.org/wikipedia/en/thumb/1/10/Stratton_Oakmont_logo.svg/1200px-Stratton_Oakmont_logo.svg.png

I would like to cut the lion but keep the original image size and lion in place.

right now i’m only able to cut the lion and keep the original image size, but not it’s position:

convert /tmp/stratton.png -crop 550x800+320+30 -background none  -extent 1200x1920 /tmp/output.png 

enter image description here

How can i keep the lion in it’s original position?

How can i find the offset rotation and position between two objects in 3D

I have two objects in 3 dimensions, one of them (Child) is attached to the other one (Parent) using the offset between them (XYZ – position and rotation). Using the Vector3 library, how can I find that Child offsets from the Parent?

further explination: let’s say we have the parent at position X:0 Y:0 Z:0 with rotations RX:0 RY:0 RZ:0, and there is an attached Child to it with the offset X:10 Y:10 Z:10, RX:90 RY:45 RZ:90 (which is what I want to know). Supposedly, I had the Parent with a different position and rotation, how can I get the offset between it and the Child (which in this case, it should be X:10 Y:10 Z:10, RX:90 RY:45 RZ:90) (in another word, I want the Child position and rotation as the Parent is the center of the map)

I’ve tried simple math and some other ways on the internet but with no success, since I’m pretty bad at calculating rotations (since vector3 libraries are pretty identical, so as Math libraries, any language should be fine).