I would use image slider for the building process. Are there any other method for to use in building process. If there has ready-made slides for Unity, where can I find ready-made slides for this kind of project.
What?
A âbuilding processâ - what is a âbuilding processâ? Describe the actual thing youâre creating since this name is pretty abstract/ambiguous.
A âimage sliderâ - like a scrollbar? How does this relate to a âbuilding processâ?
Iâve created games where you can place furniture into a scene that has a scrollbar region at the bottom of the screen that you drag things out of. But this was more like a decorating thing I created and the scrollbar was the least of the complexities of it (the complex thing was the drag/drop and making sure it didnât overlap with stuff). Think something like Sims.
But like say in Valheim you can âbuildâ your own houses and what not. And there is nothing in that process I would consider a âimage sliderâ.
Do you just mean a progress bar?
A UnityEngine.UI.Image
configured to be âFilledâ type can do this.
Or just google for progress bars. Thereâs a bazillion tutorials.
I mean when a building is selected from the menu, and when I put this building some place in the game world the building process will start to the end within the certain amount of time. Yes, it will have a progress bar but how can I prepare/manage the images? Through the image frames (frame by frame) asset or through a slideshow asset (if Unity has this kid of assets)?
Go look at filled UnityEngine.UI.Image components, as I listed above.
Or again, go look at tutorials. I am NOT retyping a tutorial here for you.
He may mean images as in the images for the sprites in the game. Hey Unitkiv, can you show me your game in a screenshot and tell me what you mean. Is it a canvas or not?
Is it IN a canvas
OP needs to properly describe their situation instead of us trying to guess what it is theyâre talking about.
My signature used to have a phrase in it, I deleted it a while ago though. It was somewhere in the vicinity of:
âProgramming is the act of telling a computer what you want. If you canât describe it to us as humans⊠what makes you think you can describe it to your computer?â
OP⊠maybe some pics of what youâre trying to do?
Are you intentionally being vague?
Iâm watching Code Monkeyâs Simple Building System in Unity tutorial. In the tutorial Iâve stuck in part 02:26 as I get error when I attempt to place the prefab (I modified the code. Is there has any other way to execute this code without grabbing the Utilities from unitycodemonkey.com?)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BuildingManager : MonoBehaviour
{
[SerializeField] private Transform PfWoodHouse;
private InputManager inputManager;
private void Update()
{
if (Input.GetMouseButtonDown(0))
{
Vector3 mousePosition = inputManager.GetMouseWorldPosition();
Instantiate(PfWoodHouse, mousePosition, Quaternion.identity);
}
}
}
Need to know what the error is.
When I press the left mouse button it brings me the âObject reference not set to an instance of an objectâ error message. I already put the prefab in the field of the BuildingManager component.
input manager is null (not instantiated). Check again the tutorial and see how heâs instantiating the input manager (maybe just a private inputManager = new InputManager();
)
No matter how many times you see this errorâŠ
The answer is always the same⊠ALWAYS!
How to fix a NullReferenceException error
https://forum.unity.com/threads/how-to-fix-a-nullreferenceexception-error.1230297/
Three steps to success:
- Identify what is null â any other action taken before this step is WASTED TIME
- Identify why it is null
- Fix that