I am trying to make a chat box, haven’t really had much help… Only thing that was recommended was to use a vertical layout group. However, I used that and now my scroll view doesn’t work. I just need help getting a chatbox working with UnityUI. I can handle the network side. I have a Panel_Chatbox, with a mask and scrollRect. I have a prefab “messageObject” consisting of a Panel, Image, and Text. Think of facebook’s messenger. It’s going to be similar to that, a box containing the content, a user avatar, and the text. So when the user types in the input field and hits send, that text will be the “messageToSend” of the instantiated messageObject, their avatar will be the Image, and so on. So at this point, when I hit send, the messages stack ontop of each other. I need them to remain the same width and height, but go up the parent panel, as more messageObject’s come in. Then the user can use the scroll view to go up and read previous messages. I’ve reached out on this several times cause I am completely stuck, but not really any responses, or someone telling me how to visually design the chat box. I just need to get it to work properly. I tried the vertical layout group angle but that fails as the content autoscales to the panel depending on the amount of messageObjects eventually getting tiny, and they don’t move up the list… I tried playing around with settings but no luck. I would just greatly appreciate someone helping me though creating this part

Try this, it’s based on a @BoredMormon tutorial but just fills a scroll panel with a load of rubbish text, should get you most of the way there.

Links to the tutorial are in the document.

[39376-how-to-make-a-scrollable-panel-using-the-46-unity.pdf|39376]

EDIT:

Looking at that video you’ve deffinately got your pivot point in the wrong place as that’s exactly what happens when you leave the pivot in the center. If you got through that document and the related Richard Gubb tutorial it show you how to move the pivot. I suspect to force it to show the bottom one you’ll need to set that VerticalNormalizedPosition like I said.

I’ll be able to check when I get to a PC with Unity though, should be in a couple of hours.

Nice design BTW.

EDIT 2:

OK the content of the button probably need a content size filter rather than a fixed size with, set the mimimum size and also add a contentSizeFilter to expand should the text increase. You probably want to switch off the best fit part of the text for that to work and just stick with a font size of your choice.

Difficult to work out without Unity around to cheeck the values but we’ll get it sorted don’t worry.

EDIT 3

OK on the scroll panel where I assume you now have the pivot at the bottom change the Content Size Filter to Vertical Fit = Preferred Size. That works for my simple text display but you may need additional scripts on you panel as it’s more complex.

I have 4 scroll rect in my project and they are aligned like one is parent scrollrect and others are there chid of that parent scroll but the problem is that after the first scroll child go to the last position it do not go to the second child of the parent scroll. What can I do to achieve that?? Is there any method that I can call to activate the parent scroll which will go to the Second child of the parent scroll and Vise-versa???
@Mmmpies can you solve this problem??? I’m not able to solve it!!!