Adam's Lair Forum

game development and casual madness
It is currently 2019/11/12, 04:12

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Set GameObject origin ?
PostPosted: 2016/03/01, 03:00 
Member
Member

Joined: 2015/12/27, 00:33
Posts: 76
Role: Hobbyist
Hello !

Is there a way to set a GameObject's origin ? Or do I need to manually modify the renderer's rect ? (I know I'm lazy :P)
Because it's unnerving :
Gfycat Video - Click to Play. [Source]


Top
 Profile  
 
PostPosted: 2016/03/01, 14:10 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 354
Location: Out there
Role: Hobbyist
GameObject has a Transform where you have it's center position (.Pos).

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
PostPosted: 2016/03/01, 14:39 
Forum Adept
Forum Adept

Joined: 2015/07/08, 16:41
Posts: 414
Role: Gamer
From what I see from the little video you posted, I think you're going to need to modify the renderer's Rect, like you said. It's not that hard to get it accurately, since you can see the center in the Duality Editor when you've got the object selected.


Top
 Profile  
 
PostPosted: 2016/03/01, 20:12 
Member
Member

Joined: 2015/12/27, 00:33
Posts: 76
Role: Hobbyist
Thanks for the replies !
I have another question : why aren't the Rect's properties from a SpriteRenderer changed when the scale is changed ?


Top
 Profile  
 
PostPosted: 2016/03/01, 20:32 
Forum Adept
Forum Adept

Joined: 2014/12/13, 00:11
Posts: 398
Location: Brazil
Role: Gamer
ChatPion wrote:
Thanks for the replies !
I have another question : why aren't the Rect's properties from a SpriteRenderer changed when the scale is changed ?

I think the properties aren't changed because you're just visually scaling them. I don't know how it works, but if the properties were changed, it would be a bit more difficult for, say, revert a Rect to its properties when it had a scale of 1.

_________________
I only know the basics of C#. I have no advanced knowledge.


Top
 Profile  
 
PostPosted: 2016/03/01, 21:48 
Forum Adept
Forum Adept
User avatar

Joined: 2015/03/15, 02:49
Posts: 354
Location: Out there
Role: Hobbyist
ChatPion wrote:
Thanks for the replies !
I have another question : why aren't the Rect's properties from a SpriteRenderer changed when the scale is changed ?

Rects properties are relative to the game object. Just like the rects position is always the same wherever the gameobject is.

Or maybe I'm wrong.

_________________
Hello there! Nice to meet you!
I have github. Apologies in advance for bad coding practices.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group