## How to align prefab to a accurate position with the best practice?

I’m making a plumber game, I have a pump prefab, and pipe section prefab, which allows the user to connect the pipe during game, the pipe needs to be connected seamlessly during game, which means pipe prefab needs to be aligned in pixel level, please check below

User needs to add more and more pipe to connect the with each other, pipe is fixed length prefab.I’ve got choices,

1.Is the pipe prefab instantiated during game play a good practice? Because it might have many pipe prefabs, if the pipe goes a long way to another position, than there will needs to be so many pipe prefabs, compared to have procedrually generated pipe mesh during runtime, then a long pipe will not have to be cut off to the same small pieces?Which is good way to adpot?

2.If I use the same pipe prefabs to fabricate the piping system, how to accurately connect each other in pixel level, I can make the whole piping system in blender, then cut the system into pieces as my prefabs, then import to Unity as my first choice, this can do pixel level connection, but it seems to have better choice solely solved pixel level connection in Unity?

3.If I do it by generating the mesh during game play, then it could be complex especially it is hard to make elbow pipe mesh during runtime, or could you please advise me of some known library or package can do the work?

## How Can I Increase Breadcrumb Position Count (Starting From 2)?

In my wordpress functions.php, I have tried increasing locations position count in the breadcrumb from 2 and above in the foreach loop (while leaving out position 1 for Homepage).

Please how can I be able to achieve this? All suggestions are highly appreciated.

Below is what I tried

function zuluma_display_breadLocation($pid) { global$  zuluma_theme;     $ad_country = '';$  type = '';     $type =$  zuluma_theme['cat_and_location'];     $ad_country = wp_get_object_terms($  pid, array('ad_country'), array('orderby' => 'ASC'));     $all_locations = array(); foreach ($  ad_country as $ad_count) {$  country_ads = get_term($ad_count);$  inc = 1;         $item = array( 'term_id' =>$  country_ads->term_id,             'location' => $country_ads->name );$  all_locations[] = $item; }$  location_html = '';     if (count($all_locations) > 0) {$  limit = count($all_locations) - 1; for ($  i = $limit;$  i >= 0; $i--) { if ($  type == 'search') {                 $sb_search_page = apply_filters('zuluma_language_page_id',$  zuluma_theme['sb_search_page']);                 $location_html .= '<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . get_the_permalink($  sb_search_page) . '?country_id=' . $all_locations[$  i]['term_id'] . '"><span itemprop="name">' . esc_html($all_locations[$  i]['location']) . '</span></a><meta itemprop="position" content="$inc++;" /></li>'; } else {$  location_html .= '<li><a href="' . get_term_link($all_locations[$  i]['term_id']) . '">' . esc_html($all_locations[$  i]['location']) . '</a></li>, ';             }         }     }     return rtrim($location_html, ', '); }  The below is what i got when i view the source code <meta itemprop="position" content="$  inc++;" /> 

## Unity: How can I find the center position of a particular triangle?

I need to face an object from a central point directly through any one of many triangles which are faces on an icosphere whose position is centered on that point. Is there a way to get the center position of the triangle itself, even though its position is the position of the larger object of which it is a part?

## When I’m mounted, can I use the Bait and Switch maneuver exchanging the mount and my ally’s position?

Tasha’s Cauldron of Everything added one of my favourite maneuvers (Bait and Switch) so in my game as a player I used it while mounted and the DM was like "Nice, like in chess (The king and rook maneuver)". But I was thinking, is possible, rules as written, that me and my mount both change places with my ally?

Bait and Switch: When you’re with in 5 feet of a creature on your turn, you can expend one superiority die and switch places with that creature, provided you spend at least 5ft of movement and the creature is willing and isn’t incapacitated. This movement doesn’t provoke opportunity attacks. (…)

Is it up to the DM? Because it doesn’t specify.

## Check if NavMeshAgent can reach position with dynamic obstacles

I am currently checking if a position in the NavMesh is reachable. It is reachable without the NavMesh obstacles. But the moment I add it, NavMesh’s CalculatePath() continues to return true. Note that I do have those obstacles to have carving set to true. How do I solve this problem?

## Unity 2D Player Shoots at my joystick position

Hi I am new to unity and have only a little coding knowledge. Right now I have made my character shoot at my touch position on mobile but when ever I touch the joystick, whick I use to move my character, he shoots there, what should I do to make him not shoot at the joystick when i hold the joystick, any suggestion… heres my code.

Shooting code

public class Shooting : MonoBehaviour { public GameObject shot; private Transform playerPos;

void Start() {     playerPos = GetComponent<Transform>(); } void Update() {          if (Input.GetTouch(0).phase == TouchPhase.Began)         {          Instantiate(shot, playerPos.position, Quaternion.identity);         }         else if (Input.GetTouch(1).phase == TouchPhase.Began)         {             Instantiate(shot, playerPos.position, Quaternion.identity);         }     else if (Input.GetTouch(2).phase == TouchPhase.Began)     {         Instantiate(shot, playerPos.position, Quaternion.identity);     }   } 

}

Projectile Code

public class Projectile : MonoBehaviour { private Vector2 target; public float speed; private Shake shake; void Start() { shake = GameObject.FindGameObjectWithTag("ScreenShake").GetComponent(); target = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position); target = Camera.main.ScreenToWorldPoint(Input.GetTouch(1).position); target = Camera.main.ScreenToWorldPoint(Input.GetTouch(2).position); }

// Update is called once per frame void Update() {     transform.position = Vector2.MoveTowards(transform.position, target, speed * Time.deltaTime);      if(Vector2.Distance(transform.position, target) < 0.2f)     {         Destroy(gameObject);     }                } void OnTriggerEnter2D(Collider2D other) {     shake.CamShake(); } 

}

## Find position in array where element-wise multiplication with string of 1 and 0s results in max value

I have a sequence of 1s and 0s. For example: $$bits = [1, 0, 1, 1, 1, 0]$$. I also have an array of positive integers. For example $$arr = [12, 23, 4, 6, 8, 0, 24, 72]$$. I need to find the index, $$i$$, in $$arr$$ of the leftmost element of $$bits$$ such that

$$\sum_{j = i}^{i + \textrm{length of bits}}{bits[j – i] * arr[j]}$$

is a maximum. Essentially I am maximizing the element-wise multiplication between the two sequences starting at index $$i$$.

I need to solve it in $$O(n\log n)$$ or better, but I can only think of a way to do it in $$O(n^2)$$. I have a feeling prefix sums could be used but am not sure how.

## Can you verify a word’s position in an enumeration faster than performing the enumeration?

Pt 1. Given as input the tuple: (word, natural number)–does there exist a verifier, that runs faster than a fixed enumerator, that can accept if the word is in the position of the natural number in the enumeration by the fixed enumerator, and reject if it is not?

I suspect the answer is no. In that case…

Pt 2. Is there a way to get around this by adding a “tagging” function to the enumerator so that a verifier can be given something like (word#tag, natural number) so that it almost immediately knows, from the tag, if the word is in the position of the natural number (do there exist such ‘modified languages’) AND IT CAN’T BE FOOLED! Of course you can stick a natural number onto a word, but how can you do this so the verifier can BE SURE you aren’t lying…? Trying to figure out a way to tag the words (or generate a description for the words in a language (modify the language being enumerated/the enumerator)) so that stuck on to the words enumerated is the positions their the enumeration, and this information is reliable and can be verified quickly.

Any ideas? 🙂

## Does attacking from your echo knight while hidden give you advantage or reveal your position?

If I’m a rogue/fighter multiclass, and I attack with my echo knight (which is out in the open) while I am hidden, does the attack have advantage, and does it reveal my position?

## How should we define the behavior of a Turing machine where the head tries to move left from the leftmost tape position?

If we have a Turing machine in a model with a tape that is infinite only to the right and assume at some point the head tries to move left from the leftmost position.

How should we define the behavior in such a case? Is a machine doing so for some input not a valid Turing machine? And if so, how can we make sure when we define a Turing machine that this situation can’t occur for any input?

I’ve read some sources about Turing machines though couldn’t find the answer to this specific case, and I see no reason why this case won’t happen for an arbitrary Turing machine and some input.