Should I use Start or Update to call the given method in Unity3d -


1. I have a class in which i projectile motion () with the returned type One method is IEnumerator and this method is being said to start () 2. The above script is linked to a prefab which is immediately from any other category.

Problem:

In the IENumerator ProjectileMotion () method, I need the update status of an object to continue running, so I declared

  // It was assigned to o = gameback and it is continuously moving forward to the public goal; In projectile motion (), if I target. Transforming the situation, it only gives the initial status and not where it was initially in the prefab, on which this script is attached, however, in updating code I get updated status of updated  target  Enabled (checked using debug.log) 

But I can not call ProjectileMotion () in Updateile. Definitely, every time when the prefix is ​​interactive, then what I should do to get the updated status of the target and hence the script is called .

just put ...

If you want to execute the code , When the component is "started", start it on the call.

OR

If you want the code to execute each frame after the component has started, call it on an update.

Looking at the name of this method, I think that it is something like this, after which a throwing condition updates a gun has started it. The status of the update is possibly a per-frame operation.

I will put it in the update method.

Edit:

Unblos ...

Does this function do a Multifame Animation?

Unity is the concept of Coratine, which allows certain functions of several frames. In this case, you may be better off doing something like this in your initial method ...

  StartCoroutine (Projectile Motion)  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -