纳金网

标题: 第一视角角色设置详细步骤 [打印本页]

作者: 会飞的鱼    时间: 2011-11-1 15:28
标题: 第一视角角色设置详细步骤


           比较具体的一个小教程,对初学者比较用用!
           

           Follow step by step guide below to convert your 3rd Person Shooter Demo from UnityTechnologies to First Person Shooter.
         

            
         



            Move your Camera Near Player's arm and Attach it to Human game object. In my case x is -0.56, y is 1.38 and z is 0.025.
         


            Edit your Shooter Game Camera script as below.
         


           
         


            Edit your Normal Character FPS Script. Remove UpdateFacingDirection() function because the MouseLook script will take place for that. Also remove moveRotationSpeed variable and call to UpdateFacingDirection() function. Your script now looks like this.
         

           
         


           
         


           
         


            Attach MouseLook script to camera and Human game object. Change Axes for camera to  Mouse Y and for Human to Mouse X. You must have standard assets Character Controller package imported into project to have MouseLook script.
         

           
         


           
         


            Change MouseLook script Update() function to LateUpdate() so the movements of the camera will follows work fluid with ShooterGameCamera script.
         


            Chane HeadLookController's Responsiveness variables to 10 so it is better suited for First Person Shooter.
         


            Now we have to fix the problem of camera when we die it is destroyed and our death looks unrealistic. Edit the RagdollInstantiater Script as below.
         


           
         


           
         


            Now we almost complete our setup. Create new camera call it DeathCamera and assign it to RagdollInstantiater Script of Human GameObject. Change DeatCamera's x rotation to 90 so it sees player's head and disable the game object for now.
         


           
         


            Enjoy your new First Person Shooter. Make sure you credit RBSoft and UnityTechnologies if you use this in your game. Modified scripts can be downloaded frombelow.
         


作者: C.R.CAN    时间: 2012-3-9 23:31
呵呵,真得不错哦!!

作者: 晃晃    时间: 2012-5-7 23:24
灌水。。。

作者: tc    时间: 2012-5-17 23:28
凡系斑竹滴话要听;凡系朋友滴帖要顶

作者: 晃晃    时间: 2012-5-27 23:22
好可爱的字,学习了

作者: 晃晃    时间: 2012-6-3 23:24
发了那么多,我都不知道该用哪个给你回帖了,呵呵

作者: 奇    时间: 2012-6-22 23:22
跑着去顶朋友滴铁

作者: C.R.CAN    时间: 2012-7-19 23:21
佩服,好多阿 ,哈哈

作者: C.R.CAN    时间: 2012-10-29 23:29
俺是新人,这厢有礼了!

作者: tc    时间: 2013-3-8 23:54
我看看就走,你们聊!

作者: 晃晃    时间: 2013-3-11 23:20
凡系斑竹滴话要听;凡系朋友滴帖要顶!

作者: 晃晃    时间: 2013-3-14 23:51
先顶上去,偶要高亮加精鸟!





欢迎光临 纳金网 (http://rs.narkii.com/club/) Powered by Discuz! X2.5