Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mega Book - Easily create working 3D books Comics

Discussion in 'Assets and Asset Store' started by SpookyCat, May 19, 2014.

  1. s1lent-warrior

    s1lent-warrior

    Joined:
    Aug 3, 2014
    Posts:
    5
    Hi 6R.

    Can you guide me how animate 2D/3D Objects on MegaBook pages?

    Thanks in advance!
     
  2. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    You have to create an empty GameObject as a parent of YOUR GameObject to animate...
    Hope it helps you.
    (For more questions you can send a PM here or an e-mail at : pcizaire, at, hotmail, dot, com.)

    6R
     
  3. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,291
    Hi,

    A question on the real time colliders update. I am using it with a new system that will let particles stick as pages turn. This requires the real time update, but testing it on my laptop i see a difference of going from 13-20 ms to 80-110ms as pages turn.

    Is it possible to reduce this in some way, perhaps have it update every other frame. Also pages slow down as they open and do a very small motion with the collider update activated, when it is not really needed.

    To sum up, is it possible to do the colliders update only while the page visibly turns and not in the ease out portion, and do the update every x frame ?

    Thanks
     
  4. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    @s1lent.warrior : e-mail sent...
    In fact the most important is to make the difference between an ANIMATION and a MOVEMENT on a page.
    For an animation no empty gameobject needed... For a movement, you need one as a parent.
    Then you can animate the child object when it moves following the empty gameobject : I made this with a cat running around the page ! --> A Movement added to the empty gameobject (parent) and a RUN animation added to the cat (child).

    6R
     
  5. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    This looks like a really neat product, but I have one big question- in addition to page number, my game needs to be able to determine what chapter the user is looking at- is there any method already in the API that would allow me to subdivide a book into chapters or sections, and jump to a specific section?
     
  6. thoai.tl

    thoai.tl

    Joined:
    Feb 1, 2015
    Posts:
    1
    i have a .doc file. how i can copy the letters in file.doc and Megabook automatically generate pages for the book instead I have to do manually for each page

    thank !
     
  7. mrgoonie

    mrgoonie

    Joined:
    Jan 7, 2015
    Posts:
    6
    Hello SpookyCat,

    When I try to rotate the book by X axis (-90), I got this straight flipping animation, any ideas how to fix it?



    Thanks,
     
  8. ChaneDev

    ChaneDev

    Joined:
    Feb 12, 2013
    Posts:
    66
    Just a word of advice, you should send a support ticket through their system with the question. That is the best way to get support in my experience.

    This is on page one of this forum thread and may be your answer:

     
  9. mrgoonie

    mrgoonie

    Joined:
    Jan 7, 2015
    Posts:
    6
    Thanks for the answer, but I tried that, it didn't work.
     
  10. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just submitted a small update to the store, since the last update notice here we have made the system fully compatible with Unity 5 and fixed a couple of small bugs in the system. Also if you do have a problem with the system at all is is best to submit a support ticket at the website, the forum email notifications are too unreliable.

    Changes since v1.25

    • Created page objects now use the same layer as the original book object.
    • Made changes to make MegaBook fully compatible with Unity 5.
    • A Fwd value of 0,0,0 for attached objects will not produce log warnings now.
    • Fixed bug with Edit Page slider values being wrong if page count reduced.
    • Fixed issue with newer versions of Unity and the Undo system which would cause the editor to hang.
     
  11. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Doing what was suggested will work, just tried it in the demo scene with the Asset, select the 'Book Dummy' object and you can rotate it to have the book at any angle you need and everything works just the same. You would only get different results if you actually rotated the object which has the Book Builder component attached. Below is a grab from the test scene which shows the book rotated on the x axis by 80 degrees.
    bookrot1.jpg
     
  12. Logan_Booker

    Logan_Booker

    Joined:
    Jun 20, 2013
    Posts:
    3
    Hi SpookyCat, I was wondering, is there any way to turn multiple pages at once?

    So if I had a 10-page book, and was one page 1, but wanted to turn to page 5, I could turn all the pages in-between as a "clump" to get to page 5. Right now, you have to turn each page in sequence or "snap" to the page, which isn't ideal for our purposes.

    I'm happy to make the necessary code changes to make this possible.

    EDIT: Actually, even having multiple pages turning at once to speed the process up would be good, so instead of sequential turning of each page to get to the desired once, you'd have a bunch flipping together, like in this image:

    Of course, having both options would be preferable. :)
     
    Last edited: Mar 25, 2015
  13. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I would have to have a think about that, it would need some work with the attached object and page hole systems and other parts of the code.
     
  14. doukOmega

    doukOmega

    Joined:
    Dec 31, 2014
    Posts:
    12
    I really did not get your concept mate. I tried what you have said but it seems that i cannot move the parent object as well. Can you please clarify how we do move an object that is a page object of a page?
     
  15. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
  16. doukOmega

    doukOmega

    Joined:
    Dec 31, 2014
    Posts:
    12
    Thanks for the reply but i found a solution just now.

    book.UpdateAttachObject(book.pages[1], book.pages[1].objects[0]);

    I call this right after the move method of my object.
     
  17. doukOmega

    doukOmega

    Joined:
    Dec 31, 2014
    Posts:
    12
    Hello there @SpookyCat. I saw something intriguind on the megabook btw. There a reinitialization of the seed of the Random struct that your asset uses. I would recommend that you could use System.Random and create a unique instance with your custom modified seed on it. Why ? Well i wanted to run a random range from unity library and right after i needed to execute mbb.rebuild = true; (where mbb = MegaBookBuilder reference). There was the tricky behavior that it returned me only one value no matter how many times i repeated this procedure on the same debug session. Finally i created my own Random using system but took me some time before i figure why this is happening as i did not expect it to be honest.

    Anyhow i love your asset :D
     
  18. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    I will add that to the todo list.
     
    doukOmega likes this.
  19. Crowye

    Crowye

    Joined:
    Oct 8, 2014
    Posts:
    2
    I just bought and started testing out the Mega Book!
    Really nice work :) but I have a few questions:

    1. I want to add and/or change content of pages dynamically during runtime of the book.
    What is the best way to achieve this? Can I predefine the layout (with text meshes / images) using the dynamic mesh functionality and later during runtime change e.g. the text of a text mesh (pro) and/or the image's pixel data (or the sprite of a sprite renderer?)

    2. I read somewhere here that it is possible to use sprites (2D) as content. I tried adding a sprite to a Page X for the dynamic mesh, but the book builder does not manage to create any pages at all if I do this. I also read somewhere that any such page objects each need to have a "mesh" to work, (sprites do not?) so what is true, is it possible to include sprites on a page or not?

    3. If not what is the best approach to add an image to a page? Do I need a mesh and then make add texture into a material or is there a better approach?

    4. I'm unfortunately having some issues with the simple task to just add a simple text mesh pro object to its own page object (to be used in the dynamic mesh).

    Could the developers/(or anyone involved) please make/(or link) the scene that is used for their "dynamic mesh video example" public, so one easier can see e.g. transform values for game objects (which is hidden in the video atm) ?

    Please se attached image to see the hierarchy and property values.

    Text Explanation to what I have done so far:
    I simply create a game object "Pages" at z rotation 90 --> Create a "Page0" game object as a child to "Pages" --> Create a game object "TmPro" as a child to "Page0", including a Text Mesh Pro component with some text.
    I then add the page to another game object containing the MB Complex Page (Script) and connect these in the Book Builder like described...
    Result: No text content is shown on the pages after these simple steps.

    If anyone has done this successfully maybe you could point out if I'm doing something obvious wrong?
    Maybethe "Pages" / "Page0" / "TmPro" need to have a partciular rotation?
    I obviously rotated the "Pages" game object to 90 to make "Page0" and any future pages aligned with the table like in the video.

    Thanks in advance :) I hope anyone can clear some of my confusion up a bit! ;)
    //Cheers
     

    Attached Files:

  20. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Hi There
    The best way to get help for our assets is to submit a support ticket at the website, the Unity forum notifications emails are not reliable so it can be a few days before one checks the forum for any new posts.

    You can have a book rebuild by setting the MegaBookBuilder parms rebuild and rebuildmeshes to 'true' that will cause the book to do a full rebuild on the next frame, so you would just use scripting to set the values as you want or change your page content objects etc, then just set the rebuild params to true.

    Not sure where you read that you can use Sprites? The system requires access to mesh data to be able to add dynamic mesh content to each page. You can though attach sprites to the page surface to move with the page using the Attach Object system.

    You can define a texture for each page of the book if you just need a simple book, other than that you just define a mesh for texture making sure it has enough vertices so that it will deform along with the turning page and use the dynamic mesh system to add the content, you can then just update the material you use for your texture at any time to change the image in the book.

    We can not include the TextMeshPro example scene in the asset as it contains a non free asset, the example book does have mesh content added for each page using the original mesh content system. I will see about getting an example added for dynamic mesh content, the video though does show the process and it doesn't really matter what orientation, scaling etc you have for your mesh as you can adjust that easily in the book inspector if it is wrong.
    Chrid
     
  21. fenderrio

    fenderrio

    Joined:
    Mar 2, 2013
    Posts:
    147
    Can anyone point me to any docs or give any tips on how to implement a rigid front/back cover for the book? I've seen it listed as a feature, but can't find anything about how to use it... Thanks!
     
  22. raxel

    raxel

    Joined:
    Dec 12, 2014
    Posts:
    12
    Hey, I have purchased this system since it looks slick and would save me tons of time having to make my own system, so I will start with a thanks for making a really smooth one and putting it out there!
    Okay, so to my problem, or rather a question, does this script not work with unity built in text mesh?
    When I try to add a cube it adds just fine as a dynamic fill, but if i try to add textmesh, it starts throwing hundreds of error messages on having an argument of range, does this mean I have to go and buy some other text asset that I do not really need?
    Sorry if I sound ungrateful, its just that i'm just another indie dev, not too much money, I thought it would work with built in unity "Text Mesh" just fine without having to buy textmesh pro, Thank you in advance, hoping for a fast reply =]
     
  23. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @raxel - Sorry for not replyin earlier but the forum new posts emails just don't get sent sometimes, it is by far best to submit a support ticket at the website if you have a problem or need help. You can find the support page at http://www.west-racing.com/mf/?page_id=385
     
  24. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just submitted a small update to the Asset Store. We had a request from a user that the alpha channel in page textures be used as a mask so we have added an option in the Pages section to allow you to say whether to use the alpha channel of the page texture to control if texture pixels are added, so areas on your textures where the alpha value is 0 will be ignored, this allows to you simply blend images onto the background instead of over writing every pixel.

    Changes in v1.29
    • Added option to use the Alpha channel of a page texture as a mask.
     
  25. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Another small update to the system, this fixes an issue when not using the Spine Angle option with pages passing through the one below slightly when first turning. It also fixes the back cover closing incorrectly when the Spine Angle option is off.

    Change in v1.30
    • Adjusted animation system to stop pages going through one another if the spine angle option is turned off.
    • Changes to the Spine angle system, when not using Change Spine Angle, angle is forced to 0.
    • When Change Spine Angle is off back cover will no longer close and move through pages.
     
  26. 39thstreet

    39thstreet

    Joined:
    Jan 30, 2012
    Posts:
    104
    Just sent an email to support, but this seems like it might be a better place to ask:
    We have a book with dynamic pages with both 2d toolkit sprites and textmeshpro. The dynamic page builder throws a null exception of the first sprite on the page when it tries to reference its shared mesh. Is there a setting on the sprite or book we should be looking at? This only happens on device build (android), not in editor.
     
  27. MikeUpchat

    MikeUpchat

    Joined:
    Sep 24, 2010
    Posts:
    1,056
    Are you sure 2d toolkit sprites actually uses a Unity mesh renderer, I seem to recall it has its own internal system where it builds its own mesh data and renders it, though I might be confusing it with another 2d system, I know the Unity 3d system does not expose mesh data.
     
  28. 39thstreet

    39thstreet

    Joined:
    Jan 30, 2012
    Posts:
    104
    We just did a round of updates (2dtoolkit, megabook, textmesh pro). We were only a few weeks behind latest releases, but ... something fixed the problem. I guess we should have done those one at a time, but it seems like we're all clear.
     
  29. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Just did a very small update that removes newly obsolete methods for the upcoming Unity 5.2 release.
     
  30. willemleunen

    willemleunen

    Joined:
    Jun 22, 2015
    Posts:
    5
    Hello! I'm building a children's book with the MegaBook asset. It works fantastic! Compliments for the obvious hard work you put in!!!
    But when publishing the books turn page animations become very slow on my ipad. I hope i can fix it, but i think i need a little help. I have 27 pages, all pages have full page JPG's. I use an average of 5-10 objects on the page with some kind of buttons on which you can press to hear sounds and storyline.
    Once the page is turned, everything works smooth, but turning the page makes the app work slow, also the effects on the pages. After the page turn is complete everything is smooth again.
    I can give access to my github for debugging.
     
  31. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @willemleunen If you could submit a support ticket at the website and maybe include a video showing the problem so I can get an idea for the complexity of your scene and the settings etc, and if you could provide an example project as well that could be useful, it should be no problem having a book of that size on mobile devices. Are you using the page hole feature to reduce the overdraw?
     
  32. staraffinity

    staraffinity

    Joined:
    Sep 16, 2014
    Posts:
    7
    @willemleunen
    I'm trying to do exactly that – a children's book using the MegaBooks asset! Can I perhaps contact you in some way so we can exchange ideas and experiences on using MegaBooks in this endeavour?

    @SpookyCat
    I can’t seem to find a way to permanently get rid of the ”megafires cup” element that’s attached to each page in the dummy book. Is it possible? I’ve started working on my book using the dummy because I like its hard cover.

    Edit: Okay forget the question above about ”megafiers cup” I found the option to remove it for the book by unchecking ”Dynam Mesh”.
     
    Last edited: Oct 16, 2015
  33. HiThatGirl

    HiThatGirl

    Joined:
    Nov 12, 2014
    Posts:
    19
    QQ截图20151027160256.jpg
    QQ截图20151027160418.jpg

    I want every title can trigger event,How can I do ?
    Because the title is longer, how to make mesh bending, and the same Dynam Mesh

    and The Hover,Press,Click Title color is different
     
    Last edited: Oct 28, 2015
  34. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Looks fantastik asset, Can I create Scroll Maps with selectable level options with this?
     
  35. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @idurvesh Not quite sure I know what you mean, could you maybe share a little more detail about what you want to be able to do? The book system does allow you to attach objects to pages so you are quite free to be able to add all sorts of content to your book, for example int he video below p6r added different scenes that appear and animate on each different page.
     
  36. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Hi thanks for replay, that's interesting video.... here is one of video from Mega-Fiers,something like this I needed

    is it be possible with Mega Book or I will need Mega-Fiers ?
     
  37. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    The scroll system is part of the MegaFiers asset not MegaBook, so if you want to create the scroll as seen in the video you will our MegaFiers asset.
     
  38. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Ok,thanks for info
     
  39. g0t0_wasd

    g0t0_wasd

    Joined:
    May 14, 2015
    Posts:
    4
    Could you, please, tell, how to programmatically change pageobject, attached to the page?
    I was trying to use:

    singlePage = book.pages [0];
    myObject = singlePage.objects [0];
    print (myObject.obj.name); // For example - cube.
    singlePage.objects [0].obj = newObject; // newObject's type is GameObject
    print (myObject.obj.name); // Will correctly print newObject's name, but still no changes in real scene.

    So I don't understand how to perform this. Could you, plese, give me a hint?
     
  40. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Forgive me if this is mentioned somewhere - I see NGUI compatability, does this mean it's also compatible with Unity's uGUI?
     
  41. g0t0_wasd

    g0t0_wasd

    Joined:
    May 14, 2015
    Posts:
    4
    Hello, is there a functionality for flipping pages with finger? So page should follow input.
     
  42. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Sorry I seemed to have missed some posts here, it is much better if you need help to submit a support ticket at the website, we hardly ever get the emails from Unity saying there is a new posts in these threads.

    @g0t0_wasd - You can do that quite simply by setting the fractional part of the pageflip value to the position you want for the page, so 1.01f would be page 1 open and page 2 lifted a small bit 1.75f would be page 2 three quarter turned, so you would find the position of the touch in the bounds of the book and use the normalized x value as the fraction part of the page turn, then the page will move with the finger movement.

    @JessAlexander - If your Unity UI is using world space then yes you can attach the objects to pages in the same way as the NGUI objects or any other object.

    We have also just submitted a small update that allows you to control whether pages cast, receive shadows and if they can use Light Probes, before Unity defaults were used for these values and if you changed them in the inspector the settings would be cleared by any book rebuild, so now the values can be controlled easily. We have also made the system fully compatible with the upcoming release of Unity 5.4

    Changes in v1.33
    • Added option to define whether pages cast shadows.
    • Added option to define whether pages receive shadows.
    • Added option to define whether pages use light probes.
    • MegaBook fully compatible with Unity 5.4
     
  43. g0t0_wasd

    g0t0_wasd

    Joined:
    May 14, 2015
    Posts:
    4
    @SpookyCat
    I found a bug in asset - it is impossible to modify page turn curve. I can modify it, but after starting a game in Unity editor - it jumps back to default. That's why I can't properly normalize and set the desired behaviour.
    Also, for some reason I can't contact you via feedback section on site - that's why I'm writing in here.
     
  44. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @g0t0_wasd - Actually those curves aren't meant to be there, seems they got left in when I was doing some testing a while back the shape of them is actually controlled by the Turn Animation settings. I will remove them in the next update.

    On the subject of updates I have just submitted a new one, this now enables the use of the uv2 mesh channel in the mesh builder so in case your mesh content, custom page meshes etc make use of uv2 data MegaBook will now support that, probably the main use is for anyone using TextMeshPro since it now uses some data in the uv2 for its smooting so if you were not seeing nice smooth text before you should now. You can also disable the uv2 data use if you don't need it.

    Also since the last update here we added a couple of events to the system you can subscribe to, the bookBuiltEvent which will happen after a book has finished building and also the pageTurnEvent. Also fixed a couple of rare exceptions.

    Changes since v1.33
    • The mesh system now makes use of uv2 data channels, your mesh content may use the extra uv channel or you maybe using a system like TextMeshPro which now uses data in that channel.
    • New option in the inspector to turn off UV2 data use if it is not required.
    • Added a bookBuiltEvent which is a 1 argument callback which is invoked when a book has finished building, the argument is the MegaBookBuilder that was built.
    • Added a pageTurnEvent which is a 2 argument callback which is invoked when the book is turning to a new position, the arguments are the MegaBookBuilder that is turning and the float delta off how far away the book is away from its target.
    • Fixed an exception that could happen if your book has less physical pages than the number of content pages defined and the edit page value is linked to the page value.
    • Fixed error for depreciated castShadows method.
     
  45. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    @SpookyCat when i rebuild using the two bool params, my dynamic batching goes haywire.
    Dynamic batching: index buffer source is NULL (first IB byte 0 count 0 first vertex 0 offset 248)

    also, for some reason, my pointer enter/exit trigger events, which update the book, take time to start working. As soon as the updates kick in, that error up there stops firing. If i turn Dynamic Batching off, this does not speed up the process of the pages dynamically updating
     
  46. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    @Drowning Monkeys - Not sure I quite understand your questions, could you please submit a support ticket at the website outlining the steps you are taking for your first question so I can try and recreate what you are doing and see what is happening, and also for the second question if you can include your scripts or a test project would be best as I am not sure what you are doing there.
     
  47. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    Ok, here's whats going on (sorry - if after this you need more, i'll submit the ticket)
    This is what the book looks like before you mouse over any of the buttons



    And here's the event trigger that ive added to each of the buttons:



    When you mouse over a button, it enables the proper text from the dynamic page, and calls the following function:
    Code (CSharp):
    1. public void RebuildBook(MegaBookBuilder book)
    2. {
    3.     book.rebuild = true;
    4.     book.rebuildmeshes = true;
    5. }
    However - when mousing over a button, the first thing that happens is nothing, along with the error i showed above in the previous post (by nothing i mean the page does not update).

    Once you exit the button, and reenter a few times, you eventually get the correct behavior:



    Thoughts?
     
  48. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    You will need to submit a support ticket, we can't provide support via the forums as it is impossible to keep track off, if you can submit a ticket and include an example we can get it put in the support queue.
     
  49. Drowning-Monkeys

    Drowning-Monkeys

    Joined:
    Mar 6, 2013
    Posts:
    328
    okay i'll spend some later using a smaller project.

    Another question: is it possible to animate TMPro once its been built into the book? An example of this would be to use a dissolve shader to make it look like the text was burned into the page. Or to fade the text in/out when hovering over different buttons as in the example above.
     
    Last edited: Jun 16, 2016
  50. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,748
    Once a book is built then the pages and content are meshes and use the shaders that were in the materials when built so if the shader has a way to to do a burn effect then you can do that as if it were any other mesh. If it is only something that can be done if the mesh is a TMPro object then that wont be possible unless you attach that object to a page and activate it when the page is open and then disable it before the next page turns.