Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by erbcalb · Mar 13, 2019 at 05:21 PM · 3dfpsunityeditorpuzzlebook

How to create a book that can be called anywhere and interacted with. Like a journal.

Hello,

I have been all over the internet for the past 3 days trying to find a solution to my dilemma, but to no avail. So I come to here with my question.

Is there a way I can create a 3D book and call it when pressing a key (say "b") and flip through the pages, without creating a canvas (2D) version of it.

My goal is to make like a 3D version of this: Myst Library
Or more accurately this: Revelation Journal

I've uploaded screencasts of my current workings of it all:
My book without any follow script or anything
My book with the script posted below attached to it

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class paperLookBook : MonoBehaviour
 {
 
     public bool visible = true;
     public GameObject guide;
     public Vector3 offsetRot = new Vector3(-8f, 90f, 95f);
     public GameObject player;
 
     void Start()
     {
         transform.parent = null;
         guide = GameObject.FindGameObjectWithTag("centerGuidePaper");
         player = GameObject.FindGameObjectWithTag("Player");
     }
 
     void Update(){
         if(Input.GetKeyDown("b")){
             toggleVisible();
         }
         followPlayer();
     }
 
     public void toggleVisible(){
         visible = !visible;
         disablePlayer();
     }
 
     public void disablePlayer(){
         Debug.Log("disable player");
         player.GetComponentInChildren<camMouseLook>().enabled = visible;
         player.GetComponent<playerMovement>().enabled = visible;
         player.GetComponent<Rigidbody>().isKinematic = visible;
     }
 
 
     void followPlayer(){
         transform.position = guide.transform.position;
         transform.eulerAngles = guide.transform.eulerAngles + offsetRot;
         transform.parent = guide.transform;
     }
     
 
     
 }

Essentially in order for it to follow the player, there is a child already on the player called centerGuide. The code for it is as follows:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class centerGuide : MonoBehaviour
 {
 
     public Camera cam;
     public float distance = 3f;
 
     void Start()
     {
         cam = Camera.main;
     }
 
     void LateUpdate()
     {
         locationView();
         rotateView();
     }
 
     void rotateView(){
         transform.LookAt(transform.position + cam.transform.rotation * Vector3.forward,
             cam.transform.rotation * Vector3.up);
         Vector3 currRot = transform.eulerAngles;
         Vector3 rot = new Vector3(currRot.x + 180f, currRot.y, currRot.z + 180f);
         transform.eulerAngles = rot;
     }
 
 
     void locationView(){
         Vector3 setPos = cam.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, distance));
         transform.position = setPos;
     }
 }


At this point I have no clue what to do. I'm not sure whether I should scrap this idea and try and figure something else out or if I'm going about it a really stupid way.
Any and all help would be much appreciated!

P.S. I should mention that I am a beginner at this. I've come a good way from not knowing anything, but I still don't know some super advanced things. If you find a solution that involves something advanced, could you explain it or provide documentation or something. Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

201 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to slide in a fps game 1 Answer

How to implement the ability to move and place objects in HoloLens Application? 0 Answers

Unity Gameobjects aren't showing up in the hierarchy but can see them in gameview 0 Answers

I get errors that say GameCoreXbox after installing Cinemachine 0 Answers

3D FPS Aiming with Touch Controls 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges