How to change animation fps in the Editor - unity3d

I need to combine two animations on the same model, one I got from Internet comes as 30fps. Then I am trying to add a second animation on the same game object and I would like it would be also 30fps, but when creating the animation in the Editor, Unity set it as default to 60fps. I am not able to change that value in the Animator window and in the Inspector the value appears greyed out. I am using Unity 2020.3.29.
Is there any way to change this value in the Editor itself without coding?

Follow these steps:
In the Inspector, open the clip ( 60FPS appears greyed out as you said)
Go to the left menu and select Debug (by default you may have Normal).
Then you will have the option to edit the Sample Rate from 60 to 30, or the value you prefer

Ignacio's answer works. But another way to do that, is to change the whole game FPS using:
Application.TargetFrameRate = 30;

Related

Preview script generated gameobject in scene view when not in play mode

I create an empty GameObject and attaching some scripts for generating the mesh and texture with several properties. How could I preview the the script result in Scene View when it's not in play mode? It's show nothing now.
And I also want the preview changed when I change the property value in Inspector.
Do I need to loop read the property value every second? This seems not a good idea.
So what is the general solution for my situation? I guess there must be a commonly used way for a generated GameObject.
Here is the example, I write a script to generate Cube mesh with x, y, z size. Now there are nothing show in the scene view, and when I change x, y, z value in inspector, nothing happened except I click play.
I want to see the preview in Scene View just like I right click and created a Cube GameObject provided by Unity.
This is my Cube's inspector:
By default, MonoBehaviours are only executed in Play Mode. By adding the ExecuteInEditMode attribute, any instance of the MonoBehaviour will have its callback functions executed while the Editor is in Edit Mode too. After that, you are able to check a value change in the Update()-Method.

In Unity, the camera and directional light are not visible

When the directional light or main camera is clicked on, it just shows a dot(image below). I want to be able to see them, hence be able to control them. I am new to Unity hence any help will be much appreciated! The version of unity I am using is 2019.3.0f5
You are selecting with Rect Tool
Double click to zoom in to your object and select the move tool
Edit: And to show the Camera and Light click Gizmos
Edit 2: weird, i think someone/something changes the default Gizmos setting? try look at Gizmos's dropdown, make sure the icon is on

Unity 2D - low fps in editor, 60+ fps in build

we are developing platformer game in Unity engine. Currently in our scene are 15 npc, movement is animation based, they are navigated via scripts, they can talk to player, fight etc. Rigid body does not handle collisions, it just detects ground as a trigger. When build is created, all is nice and smooth 60fps, in editor it is 25 to 30, sometimes a lot lower which makes us sometimes a lot of problems. Do you have any experience how to make a game run smooth in editor? Thank you
if your editor is very slow you can go to the unity icon right click on it and select properties and in the target add -force-opengl in the end.
you can also increment the fps by
void Start()
{
//increase of fps
Application.targetFrameRate = 300;
}
for more info go to https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html
try to logout to unity becuase sometimes the login can make the editor running slow
Two top things are check that the profiler is not running and that the scene view is not open. These are the two most common causes (in my experience) of slow down in the editor.
You can also make sure there isn't any light baking going on, shouldn't be for 2D but worth checking.
Another thing to check is any editor only scripts, i.e. namespace UnityEditor.* usages (#if UNITY_EDITOR).
If you want an uncapped frame rate, go to project settings -> quality -> vsync mode, and turn off vsync.
Another option may be to turn off Gsync(Vsync) on your monitor and graphics card control panel
Try using Unity 2022.1.24f1, I get more fps in that build and also you can try using this free asset to get more fps.
https://assetstore.unity.com/packages/tools/utilities/frame-rate-booster-120660

UE4 Enabling Mouse During Play?

I'm extremely new to UE, and doing a few easy tutorials to get started, so I don't exactly know the correct terminology to use to help me find what I am looking for... Anyway, whenever I hit play and the game starts, my mouse disappears and I am only able to use the input that I set up; so my question is, even though I do not need mouse input for movement, as I am using WASD, how do I keep my mouse unlocked and available to move around without being locked to the camera?
When you hit play and the game starts, your mouse gets captured by the game to control the camera. If your play button is set to play in the viewport, you can release the mouse from the viewport by pressing Shift-F1. The game will still be running, but input (including from the keyboard) will be suspended and you can interact with the editor.
You can also change the default behavior of how the mouse is captured and it if is constrained to the viewport boundaries. To see these options, go into the project settings (settings button above main viewport/project settings...). On the left side of the project settings window, select 'Input' under the Engine heading. On the right side will be some mouse preferences that can change its behavior.
For instance, to allow the mouse to travel outside the viewport, change 'Default Viewport Mouse Lock Mode' to 'Do Not Lock'. I don't recommend this, but you might experiment with these to get a feel for what they do. Also, you might look up these settings in the Unreal documentation for more detail.
There are 3 blueprint nodes that change the input method:
Set Input Mode Game
Set Input Mode Game and UI
Set Input Mode UI
You want a combination of the second one and a "Show Mouse Cursor" node. However, if you are making an FPS and you use the mouse to look around, you may lose that ability with the second node above. It comes down to what your game is and how you want to use the mouse.
I had the similar issue. So I did something like this in Level Blueprints to achieve what I want.

Unity 5 - Scene darkens when switching scenes

Ok, here is a new issue.
I will attach 2 photos. (Note: this is a demo level)
The lighter image is the way the scene is supposed to look when it is loaded. And in fact, it will load that way when I go to the scene and run it in the editor.
But if I load the level using Application.LoadLevel, it loads as the darkened image. Even if I increase the intensity of the light, the level looks completely wrong.
This is happening for all my scenes, please help!
Go to Window -> Lighting.
Click on Scene tab.
At the bottom uncheck 'Continuous Baking' and press Build.
This solved the problem for me when using Application.LoadLevel();