4 Replies - 423 Views - Last Post: 13 January 2018 - 04:52 AM Rate Topic: *---- 1 Votes

#1 repgainer3   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 2
  • Joined: 12-January 18

How to set the width of a panel (unity)

Posted 12 January 2018 - 07:33 PM

I want to set the Width of my UI panel "Canvas/bar" to "5", but it's telling me that "Width" is not a part of my panel, I'm really new to C# and I really need some help, can someone explain why this code won't work, and how to make it work?

 GameObject.Find(name: "Canvas/bar").transform.Width = 5f; 

Is This A Good Question/Topic? 0
  • +

Replies To: How to set the width of a panel (unity)

#2 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6290
  • View blog
  • Posts: 21,613
  • Joined: 05-May 12

Re: How to set the width of a panel (unity)

Posted 12 January 2018 - 09:02 PM

Moving to game programming...
Was This Post Helpful? 0
  • +
  • -

#3 repgainer3   User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 2
  • Joined: 12-January 18

Re: How to set the width of a panel (unity)

Posted 13 January 2018 - 01:06 AM

This is by far the worst help forum I have ever been to, never posting here again.
Was This Post Helpful? -1
  • +
  • -

#4 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14168
  • View blog
  • Posts: 56,759
  • Joined: 12-June 08

Re: How to set the width of a panel (unity)

Posted 13 January 2018 - 01:23 AM

Damn, dawg. It's a volunteer joint. Give it some time.
Was This Post Helpful? 0
  • +
  • -

#5 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 33
  • View blog
  • Posts: 291
  • Joined: 07-May 15

Re: How to set the width of a panel (unity)

Posted 13 January 2018 - 04:52 AM

You tried Rect Transform?

Transform doesnt have width/height.

This post has been edited by Radius Nightly: 13 January 2018 - 04:54 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1