Quantcast
Channel: Questions in topic: "parenting"
Viewing all articles
Browse latest Browse all 302

Particle offset on parent.transform

$
0
0
I grab an object colliders[0] by parenting it to a snapPoint on my handobject. The grabbed object colliders[0], then child of the snapPoint.transform, will start a ParticleSystem component, triggered by the grab action. Particle SimulationSpace is Local. I can do this procedure when parenting to the handobject. When parenting to the snapPoint (which is an empty child of handobject), the object grabbing works, but the ParticleSystem on the grabbed object starts with an offset. Here is the code snippet, script is a component of grabbing handobject; FadePart class lies on grabbed colliders[0]: colliders[0].transform.SetParent(transform); // this works for parenting to handobject colliders[0].GetComponent().FadeOut(); // this starts ParticleSystem correctly But what I need is this: public Transform snapPoint; colliders[0].transform.SetParent(snapPoint); // parents correctly to snapPoint on handobj colliders[0].GetComponent().FadeOut(); // this now starts ParticleSystem in offset How do I make sure, the ParticleSystem starts correctly on the grabbed object on snapPoint?

Viewing all articles
Browse latest Browse all 302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>