PlayMaker News > General Discussion

How to call a method of a attached component? [SOLVED]

(1/4) > >>

zahidur59:
Hi, I'm a Noob to PlayMaker so I just can't figure how to call a method of component attached to an Owner. I have a lineRenderer stored in FSM variable and want to call it's SetPosition method. Just can't figure out how to do that. 

I've searched the forum but failed to find anything related. Anyone care to help me out on this?

Fat Pug Studio:
There are two ways you can accomplish this. First is to create a new variable of object type and select the parameter you want to manipulate. Second is using Invoke Method, select the object that holds the component and type in the method name.

zahidur59:
Thanks for answering krmko but none of these method actually working for me. As you see I have the linerenderer saved as a variable called Laser and when I try to set the parameter of Laser, there are no access to the method setPosition or the positions are offered as variables.

For the second method, I can't select or point to the component as Its not listing it.

Am I missing something?

Fat Pug Studio:
Hmm, i'll try it out.

zahidur59:
Got a custom script to do the job but still needs to know how to invoke a predefined method of a component of gameObject. I know we can call the methods of customs scripts/behavior but don't how to do that for the standard components.

Navigation

[0] Message Index

[#] Next page

Go to full version