- Home /
ParticleSystem access code question.
Currently using version 5.3.3f1.
(1) particle.shape.radius = 1.0f;
(2) ParticleSystem.ShapeModule shapeModule = particle.shape;
shapeModule.radius = 1.0f;
If i write code like (1), an error occurs. However, if it is assigned to temporary variables like (2), it works properly. What is the reason why i can access the value if i assign it to a temporary variable? i can see that the get and set methods are implemented when i hover mouse, but can not access them right away. What does it change by assigning it to a temporary variable?
Answer by ifurkend · Jul 10, 2017 at 12:20 PM
It is a structure and has references inside. Thanks!
Answer by martn00 · Jul 10, 2017 at 12:13 PM
I think that you first need to identify what it is... What you first did wrong was that you were trying to save the 1.0f in nothing. Later you created a shapeModule and then you gave it a value.
Or it was something else... :l
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers