Closed Nicky-Jones closed 6 years ago
@DoctorMikeReddy Hi Mike, I'm wondering if you can help me I've created the scripts needed to do above, but the problem is when i downloaded from my branch to my home computer it didn't replace the the adjustments I made to the map that i did on my home version, especially Island4. so I'm wondering if you could help me out when i upload this to my branch now to choose your island over mine when it gets rebased into the master.
Currently, this appears broken, with a reference to MoveFPS being invalid in the branch.
I'm not sure how to fix this @DoctorMikeReddy I've downloaded from the branch itself and when loaded the camera code is working perfectly? I've tried just simply pushing my local to the branch but i can't because everything is up to date and it won't let me.
Have you any thoughts on how to solve this?
I’ll have another look at it. A number of times merges have flagged up errors, leading me to have to manually add items to the scene, making use of new scripts. Sometimes, there are conflicts based on compilation order, although I can’t see why this is the case here. MoveFPS isn’t a separate script is it? I couldn’t see it anywhere. Never mind, I’ll look into it when I can.
P.S. why don’t you fall straight away? I have to move for gravity to kick in. Also, can the default camera be the FPS camera, and only when E (should be Q says my brain) is tapped do we switch to freeCam. F (should be TAB my brain is whispering) should be a toggle, rather than tying up another key
P.P.S. Focus on more important things right now, like Carl’s coursework
Yes the moveFPS is a new script I created for the first person camera to Do the movement because the script for the first person camera is in Java so I couldn’t just add it in to that script.
Yes Making the camera default as the first person player is easy you simply just turn the prefab on and turn the freecam Off and the script will still do the rest.
I do not know why when moving to the fpc you’re stuck in the air unless you move, like you said gravity is there but it doesn’t seem to be applying it to the fpc when I make it teleport to the current location of the freecam.
Switching the keys is a very straight forward thing to do too, if they aren’t added in the input list you can just add them there and replace the current keys in the scripts to the new one. A 5 second job if you want to switch them (I only have them as they are now for testing purposes)...(probably)
Hope this helps :-)
On my phone so I can’t edit my post but I meant the moveFPS script is used to do the location and camera swapping, wasn’t very descriptive in my previous message.
That’ll be it. I couldn’t see a MoveFPS script. Where is it stored?
It should be with the other scripts I created for the freecam, think it’s in a folder called “scripts” but if I remember correctly there are two folders called scripts so it’s one of the two, if push comes to shove there’s a search open too. (I think)
Ok, I found that you have edited/created three scripts - two in Standard Assets->Scripts and one in Scripts. I have taken these into master branch, added the relevant scripts to the objects, FreeCam and First Person Controller Prefab, and set up attributes correctly. I also added f and r to Project Settings->Input However, while I no longer have any errors, and can fly around freeCam, the switch does not work. Can you either rebase off master, or have a quick look and tell me what I've missed, please @14016036
sorry for late response, i just tried updating off the master by checking out and git pulling (i tried rebase but i got errors so instead of screwing things up i just pulled) and when i did that I didn't find any of my updates on the Master, so if I could, I would :)
@14016036 try now. They are defo there. Maybe git fetch first?
Okey, yeah i was stupid enough to forget the git fetch part haha, okey. so i tested the code, turns out you had a couple of the objects in the wrong place, looking over my code I could be a little better with my word ing of objects.
so what i've done is i've put everything in the correct position, i've renamed some of the objects to better understand what they actually do and removed some that was there but weren't actually being used.
I also added in a little extra code to change the rotation of the camera and gameobject to the same rotation of the camera/gameobject but it doesn't seem to be working quite aswell but it was just something i noticed and thought i'd quickly implement and it seemed easy enough. will push this to my branch now.
or at least I would have if i didn't just f** switch branches and lost everything i just WROTE!
after countless issues with my branch which has left me wanting to pull my hair out, i've decided to simply create a new branch called "mikesCameraFixes" which i've updated with the fixes from the master.. hopefully you'll be able to merge that into the master without any problems
Can you update the master for island4? What did I get wrong? I tried to follow your branch with two copies of Unity open
-- WiMii?
On 1 Mar 2018, at 19:55, Nethernights notifications@github.com wrote:
Okey, yeah i was stupid enough to forget the git fetch part haha, okey. so i tested the code, turns out you had a couple of the objects in the wrong place, looking over my code I could be a little better with my word ing of objects.
so what i've done is i've put everything in the correct position, i've renamed some of the objects to better understand what they actually do and removed some that was there but weren't actually being used.
I also added in a little extra code to change the rotation of the camera and gameobject to the same rotation of the camera/gameobject but it doesn't seem to be working quite aswell but it was just something i noticed and thought i'd quickly implement and it seemed easy enough. will push this to my branch now.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
git stash and hit stash pop. Usually, changing branches gives a warning uncommitted code hasn’t been pushed
-- WiMii?
On 1 Mar 2018, at 19:58, Nethernights notifications@github.com wrote:
or at least I would have if i didn't just f** switch branches and lost everything i just WROTE!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Thanks
-- WiMii?
On 1 Mar 2018, at 20:10, Nethernights notifications@github.com wrote:
after countless issues with my branch which has left me wanting to pull my hair out, i've decided to simply create a new branch called "mikesCameraFixes" which i've updated with the fixes from the master.. hopefully you'll be able to merge that into the master without any problems
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
yeah i git stashed before checking out to my branch then it just removed all my bloody updates, was a little annoyed. something may have been thrown across the room in frustration. can't specifically remembered what you got wrong, i just removed everything and went back and readded them all myself once i cleaned up the name of the objects a little better, but if i had to guess...
oh wait, i remember, you had the wrong camera in one of the scripts also, you had the first person camera prefab in the game world inactive, which it shouldn't only the camera on that prefab has to be inactive, because all the code is doing is deactivating one camera and activating it on the other, so both prefabs can remain active in general by themselves, which is why in the code if you noticed the check when pressing the button is to check if the camera in the hierarchy is active not the prefab itself.
edit - in an ideal world I would have simply moved the camera from gameobject to gameobject, and originally i had that code, but because there is different scripts one each prefab to move the camera itself + the gameobject movement code for the fps camera is written in java, it was easier to simply have reactivating camera's than a switchable camera.
Currently working on the ability to switch between the freecam object and the first person camera object, this will work great if people are wanting to test terrain changes as the freecam doesn't have gravity so would be impossible to test with that, and is probably going to be annoying constantly having to switch between the two before starting up..
So the way its going to work is you load up in freecam mode, and when you press F the firstperson character will be teleported straight to the location of the freecam, and the camera will get switched to the firstperson camera, then when you travel some distance with the firstperson character and want to switch to the freecam, press F again and that'll make the freecam teleport to your current location and switch the camera to the freecam allowing you to fly about again.
Controls to switch is "f" to First person with gravity and "r" to switch to freecam.. had them separate for debugging but can switch them back to both "F" if people want.