One gameObject rotating another.

Hey i’ve got one object that magically cant translate or rotate another object.
Why would an object calling a public function of another object have no effect?
I really want a translation based on the parameter but for not just trying ot get it to rotate as a simple test.
The debugger definitely hits the rotation line of code. Nothing.

public class PlayerHandBehavior : MonoBehaviour{
List cards;

cards = new List ();
trans.z = -1.0f;
offset.z = -2.5f;

for(int i = 0; i < 5; i++) {
Instantiate (card, transform.position - (trans * i) + offset, transform.rotation);
cards.Add(card);
}

for (int i = 0; i < cards.Count; i++) {
cards*.Adjust();*

  • }*
    }
    public class Card : MonoBehaviour {
  • public void Adjust()*
  • {*
  • this.transform.RotateAround(transform.position, Vector3.up, -90);*
  • }*
    }

Hi, maybe you need to convert the Array cards into GameObject card
for Example:
```
*GameObject cardSample = cards[i] as GameObject;

cardSample.Adjust();*
* *or* *
*Card cardSample = cards[i] as Card;

cardSample.Adjust();*
```

You’ve never declared a method in PlayerHandBehavior, you can’t just write code in the class like that (I’m 99% sure)
You’ve never declared what trans is
You’ve never declared what offset is
You’ve never declared what card is

Is that the full code?

Can you stop posting “hi, [unrelated content]”?

oook!

i’am polite :wink: