[WORKAROUND] How to time pause in update (yield)

what I want to do is heaving a yield in middle of void update () because it’s very important that the code is executed each frame

but in end I want to have infinitive loop and need yield witch doesn’t work than I tried bypassing it with function and still doesn’t work it just doesn’t call that function

EDIT: http://www.blog.silentkraken.com/2010/01/23/coroutines-in-unity3d-c-version/

I’ve added the the corutine but still doesn’t work in mean time when this Q was waiting alone I’ve figured out how to access variables in other scripts was wandering why once I could and now I cant

strange how I can access gameobject with accessing the script;

I bypassed the wait for time with 3 more if statements if anyone knows the answer how to have wait for seconds in void Update () I would be happy to hear it

what I want working(C#):

void Start (){
	/*need for something*/

IEnumerator Wait3Sec (){
	yield return new WaitForSeconds(3.0f);

void Update () {
	while (true){

my full code (C#):

using UnityEngine;
using System.Collections;

public class CraftPosition : MonoBehaviour {
	public bool Building = true ;
	public bool Builded = true ;
	public float Smooth = 1 ;
	public float Distance = 3 ;
	public float TimeTillBuilded = 3;
	public Create Script ;
	private GameObject Player ;
	private float ObjectX ;
	private float ObjectY ;
	private float ObjectZ ;
	private float time ;
	private float time1 ;
	private Vector3 position ;
	void Start () {
		Player = GameObject.Find("Camera") ;
		Script = Player.GetComponent("Create") as Create ;

	void Update () {
		//snap position in to player's controll
		if (Building){
			Player = GameObject.Find("Camera") ;
			transform.position = Vector3.Lerp (transform.position , Player.transform.position + Player.transform.forward * Distance , Time.deltaTime * Smooth);
			// change craft object to gravity and snap out of player's controll
			if (Input.GetKeyDown(KeyCode.Mouse0)){
				transform.rigidbody.useGravity = true ;
				Building = false ;
			// player's controll the distance
			if (Input.GetAxis("Mouse ScrollWheel") > 0) {Distance += 0.5f;}
			if (Input.GetAxis("Mouse ScrollWheel") < 0) {Distance -= 0.5f;}
			// player's controll the rotation
			if (Input.GetKey(KeyCode.Mouse1)) {
				ObjectX = (Input.GetAxis("Mouse X"));
				ObjectY = (Input.GetAxis("Mouse Y"));
				if (Input.GetKey(KeyCode.Delete)){ObjectZ = 1 ;}
				if (Input.GetKey(KeyCode.PageDown)){ObjectZ = -1 ;}
				transform.Rotate (ObjectY,ObjectX,ObjectZ,Space.World);

		// after 3 sec make object to kinematic so it's builded object
		if (Building == false){
			if (Builded){
				position = transform.position ;
				time = Time.time ;
				Builded = false ;
				time1 = Time.time;
			// if it's not stationary start at beginning with new position
			if (position != transform.position){Builded = true ;}
			// if it's X seconds stationary freeze building object
			if (((time1 - time) > TimeTillBuilded) && position == transform.position){
				transform.rigidbody.isKinematic = true ;
				Script.NotBuilding = true ;
				this.enabled = false ;

Your example at the top is an infinite loop that spawns a new instance of a coroutine forever and can’t possibly work on any level, so I don’t know why you’d want that. I would strongly recommend that you avoid using Update entirely in this case, since it does not mix well with coroutines. From what I can make out, it sounds like you should use something like CoUpdate.