• Unity3D - Discussion
    5,004 replies, posted
I am having a really odd problem with jitter and I can't seem to figure it out. I am working on a 3rd person character rig, the movement is controlled by rigidbody velocities, and the camera smoothdamps to the correct position and distance behind the character. When I use the mouse look script (only using the Y Axis) there is severe jitter. But when it's deactivated there is no jitter at all. This is the entirety of the Update function of the mouse look script. [code]yRotation += Input.GetAxis("Mouse X") * lookSensitivity; currentYRotation = Mathf.SmoothDamp (currentYRotation, yRotation, ref yRotationV, lookSmoothDamp); transform.rotation = Quaternion.Euler (0, currentYRotation,0);[/code] The update function for the camera is [code] //ct is camera transform ctarget = player.position + (player.forward * cameraZOffset) + (player.right * cameraXOffset) + (player.up * cameraYOffset); ct.position = Vector3.SmoothDamp (ct.position, ctarget, ref ctargetV, cameraLooseness); ct.LookAt (player.forward * cameraZTargetOffset);[/code] Sorry for adding to the piles of questions but I have been working on this for a few hours and I want to make sure it isn't something stupidly obvious. I have already tried interpolate on the rigidbody but it seems to do nothing.
Take a look at both scripts again - one script is doing: [code] transform.rotation = Quaternion.Euler( 0, currentYRotation, 0 ); [/code] And then the other script is doing: [code] ct.LookAt( player.forward * cameraZTargetOffset ); [/code] Both modify the camera's rotation, so they directly conflict with each other.
[QUOTE=KillaMaaki;45933907]Take a look at both scripts again - one script is doing: [code] transform.rotation = Quaternion.Euler( 0, currentYRotation, 0 ); [/code] I am not sure be And then the other script is doing: [code] ct.LookAt( player.forward * cameraZTargetOffset ); [/code] Both modify the camera's rotation, so they directly conflict with each other.[/QUOTE] I am not sure if that's it. MouseLook affects the player object's rotation, the camera script is telling the camera where to look. Neither of them are parented to each other. It still jitters with the lookat commented out.
Is the camera a child of the player? EDIT: And otherwise, what does happen if you comment out the LookAt line?
[QUOTE=General J;45930542]you are totally able to price that at a reasonably high cost. Afaik nothing like that exists on the market and it really looks perfect for what it's trying to be. If someone was paying you to create that for a game how much would you want to be paid for it? That should be the starting area in choosing a price. I'd say start in around the area of $20, even though I could see it selling for higher.[/QUOTE] Thanks for the info. In the meantime, I want to try and sell something I constantly reuse in my projects. It's a basic Ace Combat style missile that is fully configurable in all the ways that a simple arcade style missile would be. (Top speed, acceleration, acceleration time, turn rates, seeker cones, etc.) There's already a physics and guidance package on the asset store for a more realistic missile model that sells for $10, but these will be simpler and include spiffy looking visual effects by default. I think this could be a good trial run for my asset store escapades. [img]http://38.media.tumblr.com/dc79d686d2ae3e0a9632241e059bd8fd/tumblr_n0oatrXdHI1r9waklo2_400.gif[/img] [img]http://33.media.tumblr.com/dadd8c02834db13718d05f6cec91ec5e/tumblr_n0oatrXdHI1r9waklo3_400.gif[/img] These gifs are ancient (7 months old) and I could make much better looking effects now, but they do a good job of showing off how different missiles act based on the settings you give them. Collisions are disabled so you can easily see the turn rates and speeds of the missiles. I've used them in any project I've done that's needed missiles, which is pretty much all of them. Sometimes I expand on them add a few extra features. The missiles in the missile dodging minigame I made awhile back are an example of an implementation of them with just a tiny bit extra added so I think there could be some value in putting this on the store. [quote][media]http://www.youtube.com/watch?v=5etZ9vzDaqg[/media][/quote]
The end in "Dodge the Missiles" is sweet :D!
I have finally got multiplayer working with bolt! Must say, the plugin is super bloody great once you get the hang of it!
[QUOTE=cam64DD;45935817]I have finally got multiplayer working with bolt! Must say, the plugin is super bloody great once you get the hang of it![/QUOTE] Didn't some facepuncher make this plugin?
[QUOTE=KillaMaaki;45933953]Is the camera a child of the player? EDIT: And otherwise, what does happen if you comment out the LookAt line?[/QUOTE] I figured out what the issue is. It was the character movement script which is completely baffling. EDIT: NOPE. Somehow after after testing it again the jitter is back. I am just going to rewrite the standard character controller in c# and be done with it. I have no idea what is going on with this thing. Imported the 3rd person character controller, disabled my character movement script, disabled their camera and attached my own camera and mouse look scripts: No jitter when rotating the camera. Disabled my character movement script, the jitter is still there when rotating the camera.
[QUOTE=reevezy67;45931978]Speaking of Bolt, 50% off for the next 48 hours. [URL]http://www.boltengine.com/Buy.aspx?CODE=L96QSFFDFRG9Y[/URL] [B][/QUOTE] WOW [t]http://i.imgur.com/yuodJ5E.jpg[/t] [B]$#@%![/B]
Is it possible to serialize a gameobject so that I can reset it to a prior state, without having to explicitly handle specific properties?
Not automatically.
I now understand the new GUI system, and have seen that it is good. [video=youtube;DewdLiAb2Ms]http://www.youtube.com/watch?v=DewdLiAb2Ms&feature=youtu.be[/video] And holy hell that seems to have come together nicely. It's almost fun to use all these machines now. Additionally, turrets and things now actually shoot at enemies, so you can now officially create your own defences, after however-fucking-long.
The new GUI really is a game changer and makes so many things possible now that I wouldn't have even bothered attempting before. I love it.
How can I get all components on a gameobject that implement a particular interface? I'm doing what people on the forums and unity answers say to do ... [code] foreach ( GameObject stateObj in state.objects ) { // This is what is supposed to get the interfaces but it is always null IResettable[] resettables = stateObj.GetComponents( typeof( IResettable ) ) as IResettable[]; if ( resettables != null ) { foreach ( IResettable reset in resettables ) reset.Reset(); } else { print( "No resettable interfaces found on [" + stateObj.name + "]" ); } }[/code] ... but it's just returning null.
[QUOTE=Cyberuben;45923915]Does anyone know how to use the gyroscope? I'm basically looking for the axis that goes from the bottom of the phone to the top of the phone. We're making a game where a player falls down and by tilting you have to direct him. I tried playing around a bit, but I was only able to get the giroscope to work in an X shape (tilting to left would make it go to the left top, tilting to the right make it go to the right bottom)[/QUOTE] Bumping this. Our project depends on this entirely.
[QUOTE=Pelf;45941085]How can I get all components on a gameobject that implement a particular interface? I'm doing what people on the forums and unity answers say to do ... [code] foreach ( GameObject stateObj in state.objects ) { // This is what is supposed to get the interfaces but it is always null IResettable[] resettables = stateObj.GetComponents( typeof( IResettable ) ) as IResettable[]; if ( resettables != null ) { foreach ( IResettable reset in resettables ) reset.Reset(); } else { print( "No resettable interfaces found on [" + stateObj.name + "]" ); } }[/code] ... but it's just returning null.[/QUOTE] In Unity5 you can do [code]var components = obj.GetComponents<IResettable>();[/code]
[QUOTE=garry;45943768]In Unity5 you can do [code]var components = obj.GetComponents<IResettable>();[/code][/QUOTE] About goddamn time.
Basically the same as my previous post, but HAH this is actually fun. Slowly replacing all of the other GUI interfaces with new ones. [img_thumb]https://dl.dropboxusercontent.com/u/107588088/IHAVEGUI_2.png[/img_thumb] (though some of the text is off-looking now that I look at it grr)
Just for funsies, I recreated a good portion of the first case from Phoenix Wright: Ace Attorney in Unity. [video=youtube;wgr1_BR0v5I]http://www.youtube.com/watch?v=wgr1_BR0v5I[/video] Has working systems for multiple choices in dialogue and cross examination (both "Hold it!" and presenting evidence to contradict a statement). Missing a few dialogues here and there on accident, oh well >.> [editline]10th September 2014[/editline] I also have to say, thank god they're changing how 2D/3D sound works in Unity. Having to reimport entire music tracks just to change from the default 3D to 2D is stupid.
Great news for some, Bolt is getting a master/lobby server done in about a month or so. Glad I've bought it, since it's really getting more and more efficient. Especially when coming from the Source modding world, which is just fantastic. Hopefully we'll be getting those long awaited documentations soon, the current stuff can be really confusing and misguiding at first.
Jealous of that early Unity 5 access, meanwhile I've been waiting a week for my pro copy of 4. Takes forever to process through Studica.
I haven't jumped into Unity networking yet, but is the included Raknet so bad that it should be avoided?
[QUOTE=reevezy67;45945011]Jealous of that early Unity 5 access, meanwhile I've been waiting a week for my pro copy of 4. Takes forever to process through Studica.[/QUOTE] I had my key within 48 hours but I already had my student ID validated before I ordered it.
[QUOTE=foszor;45945203]I haven't jumped into Unity networking yet, but is the included Raknet so bad that it should be avoided?[/QUOTE] Basically? Yes. Although I should note that it's probably wrong to call it "Raknet"... it may be built on Raknet, but it is not the same thing. The correct term is Unity Networking. The new stuff they've announced will be called UNET.
Are there any tips for decreasing player jitter/lag in Bolt? I never bothered with syncing position/rotation, as Bolt has it all handled. But after doing a test today on my game, I had about 7 people on. And some of them jittered a bit, and it just didn't quite look right. I mean it worked right, and basically synced them fine, but it seemed like it could be much better.
I'm sorry to bother you all with such noobish questions, but... In Bolt, how can I deactivate an object for everybody? I mean, in my weapon system, the current weapon is always active while the other weapons are deactivated. How can I make sure that I'm replicating gameobjects being disabled or enabled between clients and the server?
You'd probably send which weapon is active, and have the client make sure the correct weapon is activated and deactivate the others.
So, let's say, I could have an array with GameObjects. Those are the weapons. In the player's command, I could add an Integer value, which would be the weapon array index. How would I verify whether the current weapon is the one in the player's command? An event or through the good ol' update function?
Add an integer to the players state in bolt, change it to the weapon index whenever they switch weapons.
Sorry, you need to Log In to post a reply to this thread.