_id
int64
0
49
text
stringlengths
71
4.19k
0
Drawing a dynamic indicator for a field of view My goal is to draw a dynamic indicator for a cube, which represents the field of view. The ideal indicator would look the same as in Metal Gear Solid(the blue ones) From what I have gathered, I need an angle and a length for the indicator as such for a 50 FoV Now my issue is what method should I use to draw the indicator? A procedural mesh or is there a less demanding way of doing this?
0
Unity HDRP transparent material back face rendering front face culling I try to render an object with 2 different transparent materials. One should only render the back faces (higher opacity more color) and one only the front faces (lower opacity less color). The purpose is to show another object inside the mesh better, while keeping the more saturated color on the back faces. I tried to only render the back faces using a shader graph, but it seems to be impossible to only render back faces with TRANSPARENT material. With opaque materials, it was not a problem to isolate the back faces. Is there a way to only render back faces of a transparent material, and overlap them with another material that only renders front faces? (btw. this is the model, I need it for. The bones should pretty much preserve their details color, while the jello is a rich green (screenshot from blender)) Any help is very appreciated! Thank you!
0
Unity or MonoTouch with XNATouch MonoGame? same price After figuring out the pricing of monoTouch and Unity, I've found that the pricing will be the same ( 800). With XnaTouch MonoGame for monoTouch I am able to port my games to droid apple. I am just curious if anyone has tried both XnaTouch and Unity and which one they prefer. I do mostly 2D games (if Unity had a 2d Engine I would be all over that) so xnaTouch seems that it might be better, but Unity seems better for more advance professional (more companies are using it, so if I ever wanted to do this for more than just myself I have more options, which I've thought about) (I also read somewhere that monoTouch is against the new apple term of agreement?)
0
How to rotate a 3D character on top of a plane with an isometric picture on it How to calculate the angles of the 3d charater so that it fits into the isometric environment projektet on a 2d plane? Also, how do you calculate the rotation of my character? What I want to achieve Describing the scenario
0
Level Selector with possible future levels? Unity I have a level select screen which is a simple grid layout of my levels. The level data comes from a scriptable object for each level. The problem I have is what is the best method for populating the grid of levels that use the scriptable object and is able to add more levels to the grid layout if let's say I add an asset bundle in the future? My thought was that I use a levelDB which holds a list of all of the scriptable objects. Then when an asset bundle is used then it adds the content to the levelDB. The UI would then just use this levelDB to populate the screen. NOTE I have very little to no knowledge of how asset bundles work and what you can, and cannot do with them.
0
How to decompose a 4x4 TRS transformation matrix with negative scale? As the title says I need to decompose 4x4 TRS transformation matrices and extract the proper scale vectors and the proper rotation vectors (or rotation quaternions). I know how to extract those information when the upper 3x3 matrix determinant is not negative. The problem is that those matrices can have that negative determinant and as far as I could understand, this negative determinant indicates a flip or mirrored transformation. What do I have to do to extract the proper values for scale and rotation in those cases?
0
Render problems (black, purple and blue effects) in old GPU and Unity3D 5.6 project on Unity 2018 Well, I have a PC that has a GPU from 2009, and now I have some problems with a fork. The project was on Unity 5 (2015) and I have upgraded it to Unity 2018.1.0, without any problems. But some times, when I updated scripts or changed something in the scene the problem appeared. Is a rendering problem that only occurs in DirectX 10 (my GPU is a GeForce 9600 that supports up to DX 9.0c, so I don't underatand how this is capable of running DX 10). Because, if I run with force opengl all runs fine. I can go back, but the problem is in the Library folder, because if I use "Assets Reimport all" or I remove this folder, the problem dissapeared (before, not now). This is the problem https i.gyazo.com eb9199b8590fddf416a8323331e20856.mp4 Researching I have worsened it https i.gyazo.com dbc5d5f19a845ec77e54d64e3cba85cc.mp4 https i.gyazo.com 939c8fdf5fd4d68e434958e93e68da14.mp4 As you can see, sometimes the problem is blue and purple, and other times is completely black. The last problem remembers me to https forum.unity.com threads black textures on some devices android versions.195328 I have builded the project and there isn't any problem, so the problem is somewhere in the Editor or with a UNITY EDITOR preprocessor directive. I don't know what I have to do to fix this. Is like this is very random. Any help?
0
Shadow Glitch on Mesh Stitches I use LWRP, one Directional Light and Hard Shadows with 1024 resolution. When I imported this super simple mesh from blender this happened What is this weird line on the stitch of the mesh and how do I fix it? I tried using Soft Shadows with higher quality but it did not help.
0
URP PostProcessing doesn't work? I'm trying to get postprocessing work again after updated to URP. But it does not work !! Could anyone help me with any solution or clue ?
0
UI and line renderer layer order when using screen space camera I'm using a canvas with screen space camera because I needed a line renderer that could work for my UI. However, I need that line to render behind Image elements on my canvas and I'm not seeing any way to accomplish that. Every UI element on my canvas behaves like its z 90 and "order in layer" 0 but those aren't really configurable values for a UI object. My line renderer, if z 90, must have a layer order 0, or a z value lt 90. In both cases, it shows on top of my UI. I essentially have a canvas with a background image, which must be behind everything else, a line renderer (used to connect "dots"), and circle shaped Images which must be on top. Here's my hierarchy Canvas Background (Panel, no image, color) GameBoard LineRenderer (Layer default, order 0) Circle Clone(1) Circle Clone(2) etc... What's bizarre is that if I turned off (active false) the Background object, and my LineRenderer is z 90, order 0, it works fine. It appears behind my UI elements correctly. Yet if this object is active, my LineRenderer appears on top of of the elements, despite no z order changes.
0
Increasing spawn difficulty I'm trying to increase the difficulty of the game over time. I'm using InvokeRepeating to spawn enemies and in the update function I calculate the next spawn time using the following code public Vector2 secondsBetweenSpawnsMinMax float nextSpawnTime void Update() if (Time.deltaTime gt nextSpawnTime) float secondsBetweenSpawns Mathf.Lerp(secondsBetweenSpawnsMinMax.y, secondsBetweenSpawnsMinMax.x, Mathf.Clamp01(Time.time 60)) nextSpawnTime Time.deltaTime secondsBetweenSpawns public void StartNewGame() InvokeRepeating("Spawn", 0.1f, nextSpawnTime) public void Spawn() Vector3 enemySpawnPos spawnPoint.position Instantiate(enemy, enemySpawnPos, Quaternion.identity) I'm fixing the secondsBetweenSpawnsMinMax.y to 3 and secondsBetweenSpawnsMinMax.x to 1. The issue I'm facing is that the nextSpawnTime doesn't change. It starts at 3 and stays at that value when it should go down to 1. I'm not sure what's wrong with the code here.
0
How do you upgrade your Unity license from Plus to Pro? If I buy a Plus license for Unity for only one month, can I upgrade that license from Plus to Pro in the next month? Or I am in am annual commitment to renew only the Plus license? If I need to upgrade from Plus license to Pro license a month after publication, what do I do?
0
Unity VS debugging only with UnityVS? Hi, this one thing isn't clear to me Is it possible, to debug C of Unity 4.3 with Visual Studio 2013 without any plugin? If no, what or how else should I debug then?
0
Unity3d Colliders not working on my characters I have create 2 characters in maya and imported them in Unity3d. I am able to move and animate them in unity but the characters are not colliding with each others. I have tried all major colliders capsule, box and mesh. I am kind of stuck in it !
0
How can I set the radius the object will rotate around the target? using System.Collections using System.Collections.Generic using UnityEngine public class TargetBehaviour MonoBehaviour Add this script to Cube(2) Header("Add your turret") public GameObject Turret to get the position in worldspace to which this gameObject will rotate around. Header("The axis by which it will rotate around") public Vector3 axis by which axis it will rotate. x,y or z. Header("Angle covered per update") public float angle or the speed of rotation. public float upperLimit, lowerLimit, delay upperLimit amp lowerLimit heighest amp lowest height private float height, prevHeight, time height height it is trying to reach(randomly generated) prevHeight stores last value of height delay in radomness Update is called once per frame void Update() Gets the position of your 'Turret' and rotates this gameObject around it by the 'axis' provided at speed 'angle' in degrees per update transform.RotateAround(Turret.transform.position, axis.normalized, angle) time Time.deltaTime Sets value of 'height' randomly within 'upperLimit' amp 'lowerLimit' after delay if (time gt delay) prevHeight height height Random.Range(lowerLimit, upperLimit) time 0 Mathf.Lerp changes height from 'prevHeight' to 'height' gradually (smooth transition) transform.position new Vector3(transform.position.x, Mathf.Lerp(prevHeight, height, time), transform.position.z) Now it's rotating in a constant radius. I set the variable axis to 0,1,0 But if I want the object to rotate around the turret very close to it or very far ? I want to add a radius variable so I can change and set the radius.
0
How to check metadata stored in FBX files? Is there a way to check and edit metadata information stored in FBX files? I'm using 3ds Max's fbx exporter. Can this be done with it or is there any other tool for that? For example adding name, contact info, tags or anything that provides ownership of the file.
0
Unity3d "random" transform position values on editor Run into some strange behavior on editor position values. https youtu.be DUBpbOUkbfo As you can see we have two cube object with colliders on both and rigidbody on parent. After start play mode parent object editor values sets to some random numbers while transform.localPosition and transform.position is still (0,0,0). This somehow related to parent child physics hierarchy but can't understand how.
0
Move enemies over the network without sending their positions I am trying to move enemies on two clients without sharing their positions. I use this startingPosition GetRandomDir() Random.Range(1f, 10f) To have the same movement on clients and server, I set the same seed to get the same directions with Unity Random. I set it with the system datetime now ticks on server and clients Random.InitState(newTicks) I am getting the same movements on the server and on the clients until a enemy starts looking for a player and chasing that player. When this happens, the enemy on one client is not at the same position on the other client. One enemy is targeting a player on one client, but on the other client he hasn't targeted that player yet. The enemy keeps wandering creating a different position on one client than on the server or other clients for example. Is there a better way to synchronize the enemy movement ? My idea was not to send the positions of the enemies from the server to the clients but rather have the clients move their enemies themselves. I would also like to know what to search for on Google to get help with this problem networking ai movement doesn't help, synchronize movement over the network without sending position does not return the results I would like either. What I think is strange and I don't understand is that the same code is executed on both the client and the server. The players and the enemies are at the same positions. Yet the enemy will choose to chase a player on the server and not to chase a player on the client. Resulting on the client to view the enemy at a different position than the position of the enemy on the server.
0
Is there a way to use the UnityEngine.UI with SteamVR and the Vive? I recently got into developing VR games using the Vive as my standard platform. Now I would like to design some UnityEngine.UI elements that would be interactable via the built in pointer scripts that come with the SteamVR module from the Unity Asset Store. However, I can't seem to find any kind of built in method for allowing interaction between the pointers and buttons, scroll bars, etc. I have also been unable to write anything myself that would do the trick, it's almost as if the Unity UI is just not designed to interact in a VR environment at all. Does anyone have a method for using the UnityEngine.UI in a VR environment? If so, can you please point me in the right direction?
0
Unity Seamless Terrain I am programmatically generating terrain using unity's terrain object and assigning height maps to it via the terrainData, the problem is that there are seams even when using the GroupingId(which is used for auto connect). I even tried creating a terrain object in the editor with neighbours, and modified their terrain data via script, seams still there. I have also tried SetConnectivityDirty after applying terrainData. Most people who have reported this seemed(lol) to have issues with their normals at the edges, I cant see that being the issue here, but if it is, how do i approach solving it given I am using unity terrains. If there is no good answer I will have to resort to custom meshes and lose all the nice terrain tool functionality. Edit Here is how I'm setting heights. var terrain GameObject.Find("test").GetComponent lt Terrain gt () var terrainData terrain.terrainData var noiseMap Tool Generators.GenerateNoiseMap(chunkSize, seed, scale, octaves, persistance, lacunarity, 0f, 0f) terrainData.SetHeights(0, 0, noiseMap) Then the actual noise generation is just a 2D array of heights, i have been using a simplified version with only 1 pass for testing. public static float , GenerateNoiseMap(int chunkSize, int seed, float scale, int octaves, float persistance, float lacunarity, float offsetX, float offsetY) float , noiseMap new float chunkSize, chunkSize for (int y 0 y lt chunkSize y ) for (int x 0 x lt chunkSize x ) float noiseHeight 0 float sampleX (x offsetX) scale float sampleY (y offsetY) scale noiseHeight Mathf.PerlinNoise(sampleX, sampleY) noiseMap y, x noiseHeight return noiseMap
0
Is Update() called on the very first frame in Unity? I'm calling Time.frameCount inside Update() and then immediately Debug.Break() to pause the simulation before Update() is finished. This of course happens (supposedly) on the very first frame, and yet Time.frameCount returns 1, as if one frame had already been rendered by at that point. Also, I'm calling Time.deltaTime the same way, on the first frame inside Update(), and it returns a value too, as if a previous frame had been rendered and took X milliseconds. Considering Time.deltaTime returns the value of the "time it took to complete the last frame", and I'm calling it on the first frame and it's returning a value, is there an "invisible" first frame that Update() doesn't run on? I couldn't find any reference to this specific issue on the Unity docs.
0
Unity Best Practise to apply Uniform Acceleration (regardless of direction) I have read a lot of other topics both on here, on the Unity forums and from Google searches that answer thing that are similar but not quite the same as my question. My question I have a Unity project with a sphere, the sphere starts at a certain initial speed and I want the sphere to accelerate uniformly over time to reach its maximum speed, regardless of bounces and interactions. Obviously an interaction will cause the Velocity to change, but I don't want the Speed to change. I started off looking for a speed LERP, but come up with the below code. I have negated and turned off all drag and friction settings on the gameobject. My current code is thus (C ) using UnityEngine using System.Collections public class Ball MonoBehaviour public float accelerationSpeed 10f public float maximumSpeed 25f public float initialSpeed 10f private Rigidbody rb private bool ballInPlay false Use this for initialization void Awake () rb gameObject.GetComponent lt Rigidbody gt () ...other functions that don't relate to this question... void FixedUpdate () Gradually increase ball speed if (ballInPlay true amp amp rb.velocity.magnitude lt maximumSpeed) rb.AddForce(rb.velocity.normalized accelerationSpeed, ForceMode.Acceleration) This code takes 3 4 seconds to accelerate the ball up to the maximum speed, and it seems to adequately bounce the ball off rigidbodies, as I want. However, I will in time be having more things interacting with the ball including explosions and other actual Force values (such as Wind), so taking this into account is this code the best way of applying a constant acceleration to a game object, regardless of its other behaviours and influences? While the above may work I'm also looking for best practise as far as possible (and memory processor efficiency if that's applicable). While obviously there are going to be unknowns (as it's excessive to show you my whole project, just for this qustion), some guidance on best methods of approach to solving this as well as improving efficiency would be appreciated. Many Thanks. EDIT To clarify my exact question Is the code above best practise when applying uniform acceleration to the gameobject while dealing with the influence of additional Rigidbody.AddForce functions on the gameobject.
0
Math question How to move extrude a cube's face in Unity? The short question is What's the math to move the face of a cube? I.e. how to stretch (or shrink) a cube in the direction of one of its faces? Here's a picture The camera shows a cube (left). When the user clicks and drags on one of the faces (yellow), the face (it's vertices) should follow the mouse and as a result expand (or shrink) the cube in the given direction (like the right cuboid in the picture above). Please note that this should be done ingame, by moving the vertices, not by scaling the object. Now, I already have the selected face and all the vertices of its four corners. Further, the distance how far it should be moved is also known. The question is, what needs to be done with the vertices to pull the face out (or push it in)? Whats the math? Your help is very much welcome. Thank you.
0
Navigate UI with Dpad from Xbox controller on Mac Unity ? So, according to some documentation I found, the Xbox controller on Mac does not return Dpad presses as vertical horizontal axes As you can see, the Dpad is only recognized as buttons 5, 6, 7, and 8, and not as horizontal vertical axes. For my character's movement, I just created code that returns 1 or 1 for axis depending on the button pressed. It works perfectly fine. But then I found another problem UI navigation. I can't navigate my menus with the Dpad on Mac because the the EventSystem is expecting navigation via horizontal vertical axes, which the Dpad is not providing. Is there any way I can turn these Dpad button presses into real horizontal vertical axes in Unity's Input system? Or is there something else I can do to make UI navigation happen on a Mac, with the Dpad?
0
How can I search for players in the same wifi in Unity? I am creating a game in Unity and I would like to create an ability for players to join the game that others have created on the same wifi. I would like it to be as effortless as possible(e.g. players don't have to find out their wifi, etc). The game is cross platform you could have one player on PC, other on Android device, etc. Now I know that there is a game that has similar mechanism to what I would like to achieve SpaceTeam. Basically you select whether you use BT or wifi, and wait for other players to join. How can I do this in Unity, or something similar that satisfies my needs?
0
Help with 3D Double Jumping in Unity I'm having some trouble with vertical movement. I'm trying to add double jumping but none of the scenarios online seem to be working, and I can only ever manage to get a single jump. Here's my code using UnityEngine using System.Collections public class Moving MonoBehaviour public float speed CharacterController controller public float speed 6.0F public float jumpSpeed 8.0F public float gravity 20.0F public bool candoublejump true public int jumptime 0 private Vector3 moveDirection Vector3.zero Use this for initialization void Start () controller GetComponent lt CharacterController gt () void FixedUpdate() if (controller.isGrounded) moveDirection new Vector3 (Input.GetAxis ("Horizontal") 2000, 0, Input.GetAxis ("Vertical") 2000) moveDirection transform.TransformDirection (moveDirection) moveDirection speed if (Input.GetButton ("Jump")) if (controller.isGrounded) moveDirection.y 0 moveDirection.y jumpSpeed candoublejump true else if (candoublejump) candoublejump false moveDirection.y jumpSpeed moveDirection.y gravity Time.deltaTime controller.Move(moveDirection Time.deltaTime) Is there something wrong with my keyboard maybe? My theory is that it's checking for the double jump in the split second after you did the first one, which isn't helpful because you're still holding the jump button.
0
Serialize classes in unity c Is there some best practices to serialize objects to file on mobile devices in Unity using C . I've tried to search it myself, but found only this link. However, it looks like here they are trying to cache AssetBundles. I'm new to Unity, but I have some experience in iOS (swift) development. Here we have opportunity to cache some objects(variables) in local storage, to avoid overusing network. So I wanted to create some static class (for example Storage), which caches variables to file permanently and return them by some key.
0
Unity Creating a panel that stretches using anchors Relative newbie to Unity so please excuse any oversights. I have a component (canvas panel) that I'm wanting to add a panel to, so that when the parent component's height changes, the child panel's height changes to match. I've achieved this manually using the inspector (see top half of attached pic) to set the anchor points at min(0.5, 0) and max(0.5, 1) (pivot is unchanged at (0.5,0.5)). I want to create that stretching panel in scripting, and have the following code that results in the bottom half of the attached pic where the rect transform's anchors aren't set at all. GameObject panel2 GameObject.Find("Panel2") GameObject divider new GameObject("RunTimeLine") divider.layer LayerMask.NameToLayer("UI") divider.transform.SetParent(panel2.transform) CanvasRenderer c divider.AddComponent lt CanvasRenderer gt () RectTransform rt (RectTransform)divider.AddComponent lt RectTransform gt () Image img divider.AddComponent lt Image gt () img.color Color.red rt.localPosition new Vector2(0f, 0f) rt.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 20) rt.anchorMin.Set(0.5f, 0) rt.anchorMax.Set(0.5f, 1) Any suggestions? I've also tried setting the min max offsets and pivot but haven't been able to create what I've got manually in the inspector.
0
(2D) Detect mouse click on object with no script attached I'm creating a 2D project which does not have a character. So i created an empty gameobject and attached the script to it. In the script, i have declared other objects which are in the scene like this public GameObject obj1,obj2,obj3 How can I know if obj1 or obj2 or obj3 was clicked? Is raycasting the only solution?
0
Attached objects to public Text removed on play mode (Unity) As you can see when I play the game the 'touch anywhere to start' object goes away. How do I fix this? I have added all the relevant code
0
Adding force to a 3d object in a 2d scene I have a 3d game object placed in a 2d scene (top down view) in Unity. I want to add force to the object to move it in the direction it's facing. I attached a RigidBody2D component to it and when I use the AddForce() method, it's not working as I want it to i.e. it's moving on only one plane x or y but not in the facing direction. Please help me. Edit The game is my version of Asteroids. The ship is 3d and the asteroids are 2d. The scene is in 2d. I fixed the 'y' and 'z' rotation of the ship. Now how do I add force to the ship in the direction its facing ? The Update method void Update() float rotationInput Input.GetAxis ("Rotate") if (rotationInput ! 0) float rotationAmount RotateDegreesPerSecond Time.deltaTime if (rotationInput lt 0) rotationAmount 1 ship.transform.Rotate (Vector3.down, rotationAmount) Vector3 currentRotation ship.transform.eulerAngles currentRotation.x Mathf.Deg2Rad thrustDirection new Vector3 (Mathf.Sin(currentRotation.x) 1, Mathf.Cos(currentRotation.x), Mathf.Cos(currentRotation.x)) The FixedUpdate method void FixedUpdate() if (Input.GetAxis ("Thrust") gt 0) print (thrustDirection) ship.AddRelativeForce (ThrustForce thrustDirection, ForceMode.Force) Thanks in advance.
0
How to display all the previous strings except the current strings from the list? I would like to create some sort of log to display previous strings for my game, but I still cannot figure out how to properly displaying them. I am using a button to run this method every time player clicks it. public void AddLog() foreach (string logEvent in DisplayDialogueList) logTextList.text logText logText logEvent logText " n n" This method supposed to be displaying all the previous strings that has been displayed before inside DisplayDialogueList but I can't limit the displays only for the previous strings, and it will always display all the strings from the list. I have tried the .Skip method to detect the current index of the list that are currently being displayed but it does not refresh the list, meaning if I loop to skip the first index from the list, it will always skips the first index even the current index to be displayed is second index and so on. I also having trouble to skip the last index on the list since C Unity does not support .SkipLast. Any help would be appreciated. EDIT Sorry for the confusion, this is how I managed to distinguish which is the current string to be displayed, it runs on button click public void Display() Checks to see which element from the list has the same index number as the current index if((index textIndex) amp amp !(DisplayDialogueList.Count lt index)) Displays the string from the list that has passed the argument above textList.text DisplayDialogueList textIndex index 1 textIndex index Everytime the button is clicked, the index number will be increased, so it will matches with the string with the same index from the list and displays it. UPDATE Ok I managed to skip the current displayed index and last index (thanks to the answer below) but this happens apparently The Hello, my name is Mira text is in the first index of the list. How do I make sure that text won't be displayed again after the back button is clicked, which run the AddLog()? The updated code is below if(!(index gt DisplayDialogueList.Count)) firstIndex DisplayDialogueList.First() lastIndex DisplayDialogueList.Last() foreach (string logEvent in DisplayDialogueList) if(logEvent ! lastIndex amp amp !(firstIndex currentIndex)) logTextList.text logText logText logEvent logText " n n"
0
I am having this error in unity and i don't know what's causing it I don't know how it happen this is an endless runner game The road is 15 on x and 100 on z. This is happening in android road is a cube with png image as texture it is distorted and turn blue every 2 sec.
0
Unity3D position of 2D objects with size of Object I'm making a 2D project in Unity3D. I want to place an image in the right upper corner. I've got this working, but ofcourse the image is falling of the screen for a part (and completely when I change the screenrotation). This is the code I've got for it posImage new Vector2(Screen.width imgGear.transform.localScale.x, Screen.height imgGear.transform.lossyScale.y ) As you can see in the code I've tried to adapt the position with the size of the object, using localScale 1.0f and lossyscale 0.9...f doesn't really do much as it will be changed with 1 unit. Is their a way to get the real width and height of the objects?
0
Rotating according to ground normal on Unity 3D I know there are already some threads about this, but my problem isn't exactly with the algorithm itself. I was able to use RayCast and get the ground normal, using it to store the rotation necessary to align to the ground in a quaternion using slopeRotation Quaternion.FromToRotation (transform.up, hit.normal) Where hit.normal is the normal of the ground. After this, I check whether the player is moving (the user is moving the joystick axis) or standing still. If it's standing still, I align it with the ground using transform.rotation Quaternion.Slerp(transform.rotation,slopeRotation transform.rotation,10 Time.deltaTime) When the player is moving, I rotate using transform.rotation Quaternion.Slerp (transform.rotation,slopeRotation camRotation movementRotation , 10 Time.deltaTime) Where camRotation is simply the rotation of the MainCamera(a third person one) on the Y axis and movementRotation is the rotation of the joystick axis, also on the Y axis, calculated using movementRotation Quaternion.LookRotation (new Vector3(Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical"))) camRotation Quaternion.Euler (0, cam.transform.rotation.eulerAngles.y, 0) Although the code above makes sense in my head, it doesn't work as expected, as seen in the picture below As you can see, it works fine when you're standing still, which means that the ground normal and the slopeRotation are correctly calculated. When the player moves though, the combination of all the quaternions seems to cause some kind of problem that makes the player slightly deviate from the correct rotation. It might be worth noting that camRotation and moveRotation also work completely fine on their own, so the player moves correctly according to both the rotation of the camera and of the joystick, both on the floor and on ramps.
0
What are some strategies for handling a zoomed out grid of sprites? I'm writing a grid based 2D game in Unity3D that would ideally use grid sizes of around 200x200 or so, with multiple zoom levels, including all the way out. When I tried render a 200x200 grid at the most zoomed out level where everything is visible, Unity crapped out saying that there were too many vertices to attempt to draw. This makes sense, as it's trying to render 40,000 sprites. I was wondering, how do games like Dwarf Fortress and OpenTTD manage so many sprites at once on the screen when the map is zoomed out all the way? Are there any general strategies for handling the rendering of a large number of sprites such as this?
0
World coordinates on vertical grid game for different aspect ratios (Unity) new to game development and unity so hopefully someone can help. I want to make a 2D portrait mobile game that will have a grid of constant size where units can move on in Unity. This should support different aspect ratios. To do that I was thinking to cut sections at the top and bottom of the screen for smaller aspect ratios. Additionally, I would like the coordinate system to be natural to the grid, so coordinate (0,0) would be the bottom left tile in the grid, (1,0) would be the tile to the right of that,... To illustrate this concept I drew something quickly I tried with a script that resizes the size of the orthographic camera to fit the content horizontally. Problem I had with that is that I couldn't get a good coordinate system on the grid after the camera gets resized depending on the aspect ratio since the number of horizontal world units varies depending on the aspect ratio. Any thoughts on what would be the best way to do this? Thanks!
0
Switching between world and battle scene with no or minimum loading? I am making a strategy game where the player roams a grid map. When the player encounter enemy on the map he is transferred to a quot battle quot scene where two armies are fighting in turn based battle. Imagine Heroes 3 like game. My question is Should I load the battle scene in additive mode and temporary hide the quot world map quot and when the battle is finished to just show the quot world map quot and hide the quot battle quot scene? Or i should unload the world scene and load the battle scene, and when the battle is over gt unload the battle scene and load the world scene ? I think the 1st approach will give me less loading time between the two scenes, but will require more RAM ? Second approach is standard one, but i will have loading between the scenes ? My idea is to have no or minimal loading between battle and world scenes. What do you guys thing ? Did you know what is the best practice in this case ? By the way, i am using Unity as a engine.
0
Applying Animation to specific parts of a humanoid model I have imported a humanoid character from AutoDesk Character Generator into Unity. Once you specify that you want the character for Unity, a humanoid skeleton in integrated, in order to use MecAnim. I also have a plug in that applies the user's motion data to this character and animates it. Because the plug in is free and open source, I am trying to apply the motion data to different MecAnim bones, to see if I can do so. By the way, by "motion data" I am referring to 2 arrays one that contains positions and one that contains orientations of a number of joints and bones. So, I can access these Vector3 and Quaternion data... Is it enough to just apply, for example, the left foot's orientations to the right foot, or do I need to also do it with positions, in order to inter change the animations motions movements of these 2 limbs? This is the method I have written so far public void swapLimbsPosRot(Vector3 positionsArray, Quaternion rotationsArray) Vector3 tempPos positionsArray 16 positionsArray 16 positionsArray 20 positionsArray 20 tempPos Quaternion tempRot rotationsArray 16 rotationsArray 16 rotationsArray 20 rotationsArray 20 tempRot But it doesn't work, because when I apply it to my array of transforms before updating, severe jitters show there is a fighting going on between MecAnim and my motion capture device' incoming motion data, but for now I am just wondering If you wanted to swap the animations movements motions of 2 similar MecAnim parts, what would you do? What would you swap? How would you go about it? p.s. Of course, first I tried swapping the mecanim bones (right amp left feet) but that turned out silly, as the "actual" feet of my MecAnim character had been swapped! Some code, showing how the swapping and updating are done now, hoping someone could please help me find the cause of the jitters. void Update() Vector3 latestPositions Quaternion latestOrientations if (mvnActors.getLatestPose(out latestPositions, out latestOrientations)) If this variable is set to true, then do the swapping. if (swapLimbs) swapLimbsPosRot(latestOrientations) Update both the pose and the model, using the delayed data. updateMvnActor(currentPose, latestPositions, latestOrientations) updateModel(currentPose, targetModel) Swap the rotations of different mimicking limbs e.g. LeftHand 16 amp RightHand 20 public void swapLimbsPosRot(Quaternion rotationsArray) float tempRotY rotationsArray 16 .y rotationsArray 16 .y rotationsArray 20 .y rotationsArray 20 .y tempRotY float tempRotZ rotationsArray 16 .z rotationsArray 16 .z rotationsArray 20 .z rotationsArray 20 .z tempRotZ The motion data that comes in is always the latest positions and orientations from the device, so Update modify them and then apply them to the character to animate it. So, for example, in my Update, I get the latest pose (i.e. the latest positions and orientations) and then I swap the orientations of left and right hands, but the jitters are severe...
0
Distinguish between HTC Vive controller grip buttons in Unity In Unity, I can check for grip button presses via the SteamVR API like so if(controller.GetPressDown(SteamVR Controller.ButtonMask.Grip)) ... This results in either true or false so I can only check if any grip button was pressed but not specifically which one. For Unity's Input API the documentation states 1 The grip trigger differs between platforms The HTC Vive controllers each have two grip buttons but both map to the same axis. The value for these buttons is 0.0 when not pressed and 1.0 when pressed (intermediate values between 0.0 and 1.0 are not possible). Source https docs.unity3d.com Manual OpenVRControllers.html In this case it is again not possible to differ between the two grip buttons. Is there any way in Unity to check which one of the grip buttons of a HTC Vive controller is pressed?
0
How do I make my plane appear 3D like in the "Roll a ball" tutorial? I am following the first tutorial on the Unity website, which details making a 'Roll a ball' game. I am stuck at a point where I need to make a 3D plane object it looks flat, to me, and unlike how it looks like in the tutorial. How do I make my plane look 3D? This is what I see This is what I see in the tutorial
0
Change item rotation axis in inventory item visualization I'm learning unity and i'm trying now make an inventory, i made a simple interface, and now i'm trying to make a item visualization. I look for some codes from web and i found this one using UnityEngine public class TurnObject MonoBehaviour protected Vector3 posLastFame public Camera UICam Update is called once per frame void Update() if(Input.GetMouseButtonDown(0)) posLastFame Input.mousePosition if (Input.GetMouseButton(0)) var delta Input.mousePosition posLastFame posLastFame Input.mousePosition var axis Quaternion.AngleAxis( 90f, Vector3.forward) delta transform.rotation Quaternion.AngleAxis(delta.magnitude 0.1f, axis) transform.rotation I know some code, but I'm not good with geometrics. In this code when I move my mouse horizontal way, my object turn in the Y axis. And that's good. But when I move my mouse vertical the object move in the X axis instead of Z axis. Is there a way in this code for change this? I really have difficulty to understanding geometrics in Unity.
0
Unity using WWW to download image from web. Not working from my own website, but does from other urls I have this script attached to a RawImage file in my games UI public class DownloadImage MonoBehaviour string url "http megabrogames.rf.gd pic.jpg" string url "https i.imgur.com xBSyvRx.jpg" IEnumerator Start () WWW www new WWW(url) yield return www GetComponent lt RawImage gt ().texture www.texture Both jpg files are the same. One I uploaded to Imgur, this works. The other is on my own website. The url to my website works fine, I have checked in on two computers and several browsers. All I get is the red question mark. But if I uncomment the other one instead it all works perfectly. My problem is that I have hard coded the url into the game, and I want to change the image each week. It has to be the same URL for that to work, but i think with Imgur it will auto assign whatever url it feels like. thanks for any help
0
How to test if procedurally generated level for infinite runner can be passed? I have a 2D infinite runner platformer game built in Unity 5, where the level procedurally generates itself. I need to check if it is possible to pass the holes on the level. How could I do that?
0
How to output to the Oculus and a 2D screen? We'd like to present an Oculus game to a large group of people. Not everyone will have an Oculus headset, so we'd like to output to both the Oculus and a second display. The problem is that the project uses an Oculus plugin to render its output, so all they output is two distorted circles, which doesn't display well when not wearing the Oculus headset. I thought of making a second Unity client (the "audience" client, running on the same computer as the Oculus application) that receives the output texture of an "audience" camera from the client running the Oculus version. My question is Can I use the network to send the output of a camera to the "audience" client so I can set it up for the second display, bypassing the Oculus plugin? How would I get the input on the "audience" client to map it to the screen?
0
Unity3D Making timescale freeze and resume So, I'm trying to make it where when a popup(Ui panel and text) appears, the game's time(timescale) would freeze. Then when the user enters input and clicks enter button, the popup would disappear and time would resume. How could I make time follow this?
0
objects disappear before time I created a little pool in order to better manage my enemies, to which, an enemySpawner object calls to retrieve a clone and show it on screen public class ObjectPool MonoBehaviour public static ObjectPool current public GameObject objectForPool public int poolAmmount 20 public bool growth true List lt GameObject gt objectsForPool void Awake() current this Use this for initialization void Start () objectsForPool new List lt GameObject gt () for (int i 0 i lt poolAmmount i ) GameObject obj Instantiate(objectForPool) obj.SetActive(false) objectsForPool.Add(obj) public GameObject GetPooledObject() for (int i 0 i lt objectsForPool.Count i ) if (!objectsForPool i .activeInHierarchy) return objectsForPool i if (growth) GameObject obj Instantiate(objectForPool) objectsForPool.Add(obj) return obj return null Update is called once per frame void Update () The call(EnemySpawner update) void Update () transform.position new Vector3(transform.position.x (speed Time.deltaTime), 0, transform.position.z) if (transform.position.x lt boundary.xMin transform.position.x gt boundary.xMax) speed 1 if (Time.time gt nextSpawn) nextSpawn Time.time spawnRate GameObject clone GetComponent lt ObjectPool gt ().GetPooledObject() if (clone null clone.activeInHierarchy) return clone.GetComponent lt EnemyMovement gt ().SetPlayerShip(playerShip) clone.transform.position transform.position clone.transform.rotation transform.rotation clone.GetComponent lt Health gt ().RestoreHealth() clone.SetActive(true) The problem here is, that my enemies are being deactivated on mid trajectory https youtu.be ZGHC6wwGX1E I know my issue is in my pooling, but I can't figure out what I'm doing wrong
0
Renderer.material assignment not working I have a fairly simple question I am trying to change an object's material via code with the line rend.material NewMat where rend is of type Renderer (MeshRenderer to be specific) and NewMat is of type Material. Both variables are public and assigned in the inspector and both are not null. When I now try to assign the material, nothing happens. I don't event get any error. When I look into the inspector I can see that under Materials on my MeshRenderer the material doesn't even change. The line Debug.Log(rend.material NewMat) outputs false. What am I doing wrong?
0
Is coroutine as good as a delay() function I'm new to Unity and I was learning the usage of coroutines. Is calling a coroutine as good as a delay() function? Does Unity have a delay() function?
0
How to make player instantly move to the right or left when entering a box collider I have a box collider and right now when I walk into it it says "you can't go there yet" I would like it for it to also move the player like 3 steps to the right or something. How would I do thatr?
0
Change item rotation axis in inventory item visualization I'm learning unity and i'm trying now make an inventory, i made a simple interface, and now i'm trying to make a item visualization. I look for some codes from web and i found this one using UnityEngine public class TurnObject MonoBehaviour protected Vector3 posLastFame public Camera UICam Update is called once per frame void Update() if(Input.GetMouseButtonDown(0)) posLastFame Input.mousePosition if (Input.GetMouseButton(0)) var delta Input.mousePosition posLastFame posLastFame Input.mousePosition var axis Quaternion.AngleAxis( 90f, Vector3.forward) delta transform.rotation Quaternion.AngleAxis(delta.magnitude 0.1f, axis) transform.rotation I know some code, but I'm not good with geometrics. In this code when I move my mouse horizontal way, my object turn in the Y axis. And that's good. But when I move my mouse vertical the object move in the X axis instead of Z axis. Is there a way in this code for change this? I really have difficulty to understanding geometrics in Unity.
0
Having trouble defining a FindMyTag I'm not a coder, im an artist, so this stuff doesn't make a ton of sense to me. I know enough to know I don't know enough, and i'm old enough to know my brain doesn't 'get' code... that said for context of what level of help I need ) ... I'm trying to get an AI path based on an object tag. When I instantiate the object this script is on, it should look for 'mytag' on another object in the scene, and set that as 'target' public class pickAItarget VersionedMonoBehaviour lt summary gt The object that the AI should move to lt summary gt private Transform target public string mytag IAstarAI ai void Start() Debug.Log(GameObject.FindWithTag("mytag")) GetComponent lt pickAItarget gt ().target GameObject.FindWithTag("mytag").transform The script compiles fine and im able to put in the tag I want to find in the inspector but when the object instantiates I get UnityEngine.GameObject.FindWithTag (System.String tag) (at C buildslave unity build Runtime Export Scripting GameObject.bindings.cs 195) Pathfinding.pickAItarget.Start () (at Assets Scripts pickAItarget.cs 26) I feel like I HAVE defined mytag, but obviously I don't understand something.
0
How to create video from camera? I have a 3d scene and a camera I want to create video file from camera pre set movements. If it is possible, running application by command line (without needed to "show" at video, my camera) . Is it possible in Unity ? If yes what's the best approach ? Thanks
0
Why do my character's feet slide when I auto configure a humanoid rig in Unity3D? I've downloaded an FBX animation of someone walking from the "Walking" section here. I imported that and also a humanoid character and specified the Rig for both as Humanoid (auto create). The original animation has very solid foot placement, but whenever I apply it to any character in Unity the feet slide around as if it were walking on ice. Here is a video demonstrating my issue. Is there something about the way I am getting Unity to auto rig my character that would cause this problem? It happens no matter which 3D character I use. Thanks
0
Room lighting in Unity I am trying to make a plain white room in Unity. I used six planes for the walls, but I can't figure out how to get the lighting to not look so harsh and uneven. The top picture is my best attempt using two directional lights, and the bottom picture is the look that I am trying to replicate. It is from a demo scene in the Google VR SDK 1.50 for Unity. It uses only a single point light, but when I turn it off in the scene view, it doesn't change the appearance of the room at all. How can I make my room look more like the Google VR demo? EDIT I made a big improvement by changing all my walls to be static so that they receive indirect lighting, and adding a single point light above the roof.
0
Why use Time.deltaTime in Lerping functions? To my understanding, a Lerp function interpolates between two values (a and b) using a third value (t) between 0 and 1. At t 0, the value a is returned, at t 1, the value b is returned. At 0.5 the value halfway between a and b is returned. (The following picture is a smoothstep, usually a cubic interpolation) I have been browsing the forums and on this answer I found the following line of code transform.rotation Quaternion.Slerp(transform.rotation, lookRotation, Time.deltaTime) I thought to myself, "what a fool, he has no idea" but since it had 40 upvotes I gave it a try and sure enough, it worked! float t Time.deltaTime transform.rotation Quaternion.Slerp(transform.rotation, toRotation, t) Debug.Log(t) I got random values between 0.01 and 0.02 for t. Shouldn't the function interpolate accordingly? Why do these values stack? What is it about lerp that I do not understand?
0
Unity Load Lightmaps at Runtime I'm a bit of a novice to lighting, but I think what I want to do is possible, so please bear with me. Due to the nature of my game, I've taken an approach where a singular scene game is where all of the gameplay occurs. For each level, I'm arranging all the GameObjects and Terrain in a secondary scene (named testbed) to my liking. Once I've got it to my liking, I save that to a prefab, which in turn is saved to an AssetBundle. I also generate the lighting at this point, which I can see appear in my project under a Assets Scenes testbed folder. At runtime, a script in the game scene reads the appropriate AssetBundle, and then loads amp positions all of my objects and characters. Everything about this works, except for updating the lighting. My approach is to store references to the lighting textures that have been output into the aforementioned testbed folder via a ScriptableObject (after trying and failing to use the LightingData object that appearred in this same folder) Then, when I'm loading my level up into the game scene, this block is executed public void LoadLighting(LevelKey key) var data levelMap.metaData.Find(it gt it.key key) var directions data.lightData.directions var lights data.lightData.lights var lightmaps new LightmapData directions.Length for (int i 0 i lt directions.Length amp amp i lt lights.Length i ) var lightmapData new LightmapData() lightmapData.lightmapDir directions i lightmapData.lightmapColor lights i lightmaps i lightmapData LightmapSettings.lightmaps lightmaps Based on a lot of searching, this should cause something to happen, but I can't detect any change in the scene. Does what I'm trying make any sense? Should I just scrap this and make dozens of different scenes (which I'm trying to avoid) instead? Really any advice here is appreciated.
0
How can I find if a GameObject is not exist in the Hierarchy? var selections Selection.objects.OfType lt GameObject gt ().ToList() if (selections.Count gt 0) tempSelections selections for (var i selections.Count 1 i gt 0 i) var selected selections i transformSelection.Add(selected.transform) TransformSaver.SaveTransform(transformSelection.ToArray()) transformSelection new List lt Transform gt () for (var i tempSelections.Count 1 i gt 0 i) var selected tempSelections i if (GameObject.Find(selected.name) null) GUI.enabled true else GUI.enabled false if (GUILayout.Button("Undo last selection if deleted")) transformsCount TransformSaver.LoadTransform().Length PlayerPrefs.DeleteKey("transform") For testing I'm deleting one of the GameObjects in the tempSelections List But then I'm getting exception in the editor on the line if (GameObject.Find(selected.name) null) Since the GameObject have been deleted it can't access the GameObject. MissingReferenceException The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.
0
Audio slider doesn't change value For some reason, my slider and audio resets back to 0 when I stop and play the game after I changed the value. Here is the code, I can't spot anything wrong with it using UnityEngine using System.Collections using UnityEngine.UI public class MainAudio MonoBehaviour public Slider slider void Awake() PlayerPrefs.Save () GetComponent lt AudioSource gt ().volume PlayerPrefs.GetFloat ("CurVol") if (slider) slider.value GetComponent lt AudioSource gt ().volume public void VolumeControl(float volumeControl) GetComponent lt AudioSource gt ().volume volumeControl PlayerPrefs.SetFloat ("CurVol", GetComponent lt AudioSource gt ().volume) PlayerPrefs.Save ()
0
fading from one scene to another not working I am using the following code to fade from one scene to another, but it doesn't fade. It just loads the next scene without fading. I suspect there's something wrong with the image I'm using. I used a black .png image with dimensions 425 344 that I downloaded from Google. How can I solve this issue? Fading.cs (I added this to an empty game object) public Texture2D fadeOutTexture public float fadeSpeed 0.8f private int drawDepth 1000 private float alpha 1.0f private int fadeDir 1 void onGUI () alpha fadeDir fadeSpeed Time.deltaTime alpha Mathf.Clamp01(alpha) GUI.color new Color (GUI.color.g, GUI.color.b, alpha) GUI.depth drawDepth GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), fadeOutTexture) public float BeginFade (int direction) fadeDir direction return (fadeSpeed) void onLevelWasLoaded() BeginFade ( 1) In the script of the trigger object IEnumerator gameScene2() float fadeTime GameObject.Find ("FadeObject").GetComponent lt Fading gt ().BeginFade(1) yield return new WaitForSeconds(fadeTime) Application.LoadLevel("Scene2") These are the image settings for the black .png image
0
why is my (from example) shader appearing as black? I have the following (very simple) shader pragma kernel CSMain RWTexture2D lt float4 gt Result numthreads(8,8,1) void CSMain (uint3 id SV DispatchThreadID) Result id.xy float4(1,0,0,1) Here is the dispatcher code using UnityEngine using System.Collections public class SkyShaderDispatcher MonoBehaviour public ComputeShader shader public RenderTexture output void Start() RenderTexture output new RenderTexture(256,256,24) output.enableRandomWrite true output.Create() void Update() RunShader() void RunShader() int kernelHandle shader.FindKernel("CSMain") shader.SetTexture(kernelHandle, "Result", output) shader.Dispatch(kernelHandle, 256 8, 256 8, 1) which is the default red shader (it makes the texture red). However, when I put the texture in a material and give that to an object, then that results in the object being black. Anyone seeing what I'm doing wrong? As the shader is the default example right now it should work suggesting that maybe something is wrong with the texture? Edit Trying to fit the same code on a skybox also fails. I have changed the dispatcher code into using UnityEngine using System.Collections public class launchClouds MonoBehaviour public ComputeShader shader private RenderTexture output void Start() void Update() RunShader() void RunShader() int kernelHandle shader.FindKernel("CSMain") RenderTexture output new RenderTexture(256,256,24) output.enableRandomWrite true output.Create() Material mat gameObject.GetComponent lt Skybox gt ().material mat.SetTexture(" FrontTex",output) mat.SetTexture(" BackTex",output) mat.SetTexture(" LeftTex",output) mat.SetTexture(" RightTex",output) mat.SetTexture(" UpTex",output) mat.SetTexture(" DownTex",output) shader.SetTexture(kernelHandle, "Result", output) shader.Dispatch(kernelHandle, 256 8, 256 8, 1) but that turns the sky black rather then making the sky red. This is using unity 5 32 bits with DirectX11.
0
Unity3D Efficiently loading chunks in an infinite voxel engine I'm developing a voxel engine in C using Unity and I'm currently trying to implement infinite terrain, so I took a look at other Unity voxel engines that have infinite terrain. I've seen three different ways of doing it Using a dictionary to store the chunks and store the block data in another dictionary Using a dictionary to store the chunks and store the block data on every chunk Using a fixed size array and shifting it every time the player moves The engines using approach 1 and 2 were pretty slow at chunk loading. The engines using approach 3 were faster but produced lag every time the player entered a new chunk. I've already tried to implement it using approach 1, but my chunk loading speed got slower by about 10 times, so it was really unplayable. How is it done in efficient or popular voxel engines like Minecraft or VoxelFarm? Do you have experience with voxel rendering and know a better approach? Thanks in advance!
0
Move Camera is an order so that the background doesn't move fast I have created a game where I am moving my player on a platform. The car moves fine on the platform and the camera follows the car as well. My problem is that I wanted my background to move slowly. I am using a perspective camera and I am moving camera away to create a zoom out effect when my player jumps. Do you suggest I should move my background towards right so that it creates a simple slow effect? As currently it moves very fast. here is my video demonstration https www.youtube.com watch?v xO mEXo6mNA
0
Where do components get added in Unity? In unity's GameObject class, there are a few default data members. When we add a component to the game object, light for example, where exactly does it get added? Does it become a part of the GameObject class?
0
Stencil inside Stencil? (Multiple masks on same object) So please take a look at what I want to achieve The Red and Blue part is the object I want to mask. The thing is that it will be masked by the green area, and only after that it will be masked by the cyan area, which shall act like a scrollview. Currently I use stencil shader and the first mask works, but I don't know how to apply the second mask. Also, I don't want to use the built in UI mask system for this. All the objects in the scene are sprites. The thing is that I would like to achieve a hierarchy masking system, where the kids are masked by a parent. Could you please give me a tip about what I should do in this case?
0
OnCollisionEnter2D not working I am fairly new to Unity2D and am making a 2D platformer to get used to the engine. I am trying to create a platform that moves when the player jumps on it, however, on the script for the platform the OnCollisionEnter2D method is just not being called. This is the script public class ThrustPlatform MonoBehaviour SerializeField float thrustSpeed SerializeField float thrustDistance Animator thrustAnim Rigidbody2D rb private bool thrust false private Vector2 startPos private Vector2 targetPos void Start() thrustAnim GetComponent lt Animator gt () rb GetComponent lt Rigidbody2D gt () startPos transform.position float targetX startPos.x thrustDistance targetPos new Vector2(targetX, startPos.y) private void OnCollisionEnter2D(Collider2D coll) Debug.Log( quot COLLISION quot ) thrust true private void FixedUpdate() if(thrust) rb.velocity new Vector2(thrustSpeed, 0) The player and platform are on layers that can collide with each other in the collision matrix, the player still lands on the platform, and the player has a dynamic rigid body and the platform a kinematic rigid body. As far as I am aware kinematic rigid bodies detect collisions from dynamic rigid body, I have watched tutorials where this works. Even if I change the platform rigid body to dynamic there is no detection. I have also tried using continuous collision detection on both rigid bodies but still it is not calling. If I change it to a trigger and use OnTriggerEnter2D however, the Debug line appears. This is the rigidbody for the platform. This is the rigidbody details for the player. I am very confused as to why this isn't working and I can't find a solution anywhere else (unless I am missing something very obvious).
0
Scale NonUniformScale is not applied to entity I'm just learning the new Unity ecs and trying to change the size (scale) of an entity. Everything works fine, I can change the rotation, the position but not the scale. I'm wondering why. I did various tutorials, I tried Scale, NonUniformScale, LocalToWorld, CompositScale but nothing works. Maybe some of the methods are deprecated. Here is what I have tried so far. I have multiple prefabs (planes) which are spawned correctly and each of them having a transform component. Now I want to change the scaling of all the planes. For that I use a JobComponentSystem. In the following pice of code the rotation works fine, but not the scaling. I tried LocalToWorld. public void Execute(ref Rotation rotation, ref LocalToWorld scale) rotation.Value math.mul(rotation.Value, quaternion.RotateZ(math.radians(0))) scale.Value float4x4.Scale(2, 4, 5) I tried NonUniformScale public void Execute(ref Rotation rotation, ref NonUniformScale scale) rotation.Value math.mul(rotation.Value, quaternion.RotateZ(math.radians(0))) scale.Value new float3(2, 1, 4) I tried Scale. public void Execute(ref Rotation rotation, ref Scale scale) rotation.Value math.mul(rotation.Value, quaternion.RotateZ(math.radians(0))) scale.Value 5 None of these is working. What did I wrong (the scale just stays at 10,1,10) or what is the current propper way of doing that?
0
Unity multiplayer (online) How to connect to a 'Client Host' without using Unity Paid Service I'm slightly annoyed with the official Unity guides here, because I have been following through some, and they have indeed helped me create a local network mulitplayer situation. However, at no point did they mention that using these methods (ie. UnityEngine.Networking NetworkManager NetworkManagerHUD NetworkIdentity) will require me to pay Unity for Pro, and a monthly server usage fee, if I wanted to play via internet. I've set up my own Rust server in the past and it was very simple. I just installed a Rust Dedicated Server on my desktop PC (which I have fibre internet connection) and ran the server. I could then have 20 people playing with me and we didn't notice any slow down or lag or any problems with it. (Rust is made in Unity I believe) I've tried searching lots on this matter, and there are many many differing voices of how I can do this (many out of date, and many explicitly stating its impossible without hiring a server) I disagree, and think I can make my desktop run the server, BUT I haven't a clue if I'm correct and also how I would be able to make it. Unity docs seem to be trying to hide this solution if it exists (perhaps I'm being paranoid). I have the NetworkManagerHUD all working and can play locally as I say. So, it appears that the NetworkManager allows a user to start my game in 'Client host' mode, it also allows another instance elsewhere to click "Connect Client" and has a space for IP address. Would I even need a dedicated server if a player has clicked to start as 'Client Host'? assuming I don't, how can I then connect to this host from another machine? Does typing the client hosts external IP allow this? Sadly, I don't have anybody to help me test this right now. If a dedicated server version is the preferable way to go, could anybody please help me in the direction of how to start creating this? For info The game at this stage is a very simple FPS shooter. The NetworkManager is assigning the 'isLocalPlayer' flag correctly to one instance of the player object. I see in the Editor Hierarchy that it is handling the game overall and has two player objects once I have logged in with two instances locally.
0
SceneManager.LoadScene doesn't seem to be working in Unity IDE I'm in the start screen scene of my game and I'm trying to load the actual game. I use the following code public void LoadGame() SceneManager.LoadScene ("Main", LoadSceneMode.Single) I set this method to be called when a button in the UI is clicked. When testing in the game in the unity IDE, clicking the button doesn't do anything. Is my code wrong, is the IDE screwing up, or will clicking the button never do anything in the ide?
0
Unlit Node Shadow Shader Graph How to make unlit node cast shadows? Is is possible with the current state of Shader Graph in LWRP? In this great article Toon Shader OP grabs pass from VertexLit shader. Is something similar achievable with Shader Graph?
0
Rigidbody player controller on moving platforms So basically, I was trying to make moving platforms. When I finished my prototype, I noticed that the movement on the platform is very wobbly https www.youtube.com watch?v hmBumsrlHGA amp feature emb logo To snap the player onto the platform, I am just making it a child of the platform. Anyway, I don't know what is causing this issue and was wondering if I can get any help. Thank you in advance Here, the controller code private void Movement() Extra gravity rb.AddForce(Vector3.down Time.deltaTime 10) Find actual velocity relative to where player is looking Vector2 mag FindVelRelativeToLook() float xMag mag.x, yMag mag.y Counteract sliding and sloppy movement CounterMovement(x, y, mag) If holding jump amp amp ready to jump, then jump if (readyToJump amp amp jumping) Jump() Set max speed float maxSpeed this.maxSpeed if (sprinting) this.maxSpeed 25 else this.maxSpeed 15 if(sprinting amp amp y lt 0) this.maxSpeed 15 If sliding down a ramp, add force down so player stays grounded and also builds speed if (crouching amp amp grounded amp amp readyToJump) rb.AddForce(Vector3.down Time.deltaTime 3000) return If speed is larger than maxspeed, cancel out the input so you don't go over max speed if (x gt 0 amp amp xMag gt maxSpeed) x 0 if (x lt 0 amp amp xMag lt maxSpeed) x 0 if (y gt 0 amp amp yMag gt maxSpeed) y 0 if (y lt 0 amp amp yMag lt maxSpeed) y 0 Some multipliers float multiplier 1f, multiplierV 1f Movement in air if (!grounded) multiplier 0.5f multiplierV 0.5f Movement while sliding if (grounded amp amp crouching) multiplierV 0.5f multiplier 0.5f Apply forces to move player rb.AddForce(orientation.transform.forward y moveSpeed Time.deltaTime multiplier multiplierV) rb.AddForce(orientation.transform.right x moveSpeed Time.deltaTime multiplier)
0
What's the difference between UnityEngine.Random and System.Random? What's the different between this int randomNumber UnityEngine.Random.Range(0, 10) and this on top of the class private System.Random rnd new System.Random() inside a methode of the same class int randomNumber rnd.Next(0, 10) I know System.Random must always be initialized on the top of your class what's by UnityEngine.Random is not needed. I know also that System.Random works with a intern "clock" and the "random" number is based on that. My question is now are there some other difference between UnityEngine.Random and System.Random and witch code is better to use for an Unity project?
0
Unity normal maps look wrong (URP, iOS) We're building an AR enabled app with Vuforia and Unity 2019.3, using the Universal Render Pipeline. Trouble is, on iOS our models that have normal maps in their materials look totally bad, as you can see. This is how it's supposed to look (ignore the differences in the orange background item) If we remove the normal maps, the models look fine, but since the normal maps add a lot of detail and depth to the scene, we'd rather not ditch them. We've tried to change the import settings of the normal maps, changing the compression formats and such, but that didn't make a difference. Here's an image of the material settings Is there another solution to fix this? On Android, there's no problem, by the way.
0
How to make local keyboard input move only the local player, not everyone in networked multiplayer? I am working on Unity Networking and following this Tanks Networking tutorial https www.youtube.com watch?v V6wEvT6G92M Problem is that the keyboard inputs move all the tanks in the scene. It is not detecting the local tank. And when I run the game all tanks shows the same movement but it is not giving any error. I have followed all steps in the tutorial and searched all solutions on the google. This step in Tutorial is at 11 48. Implemented Code is using System.Collections using System.Collections.Generic using UnityEngine using UnityStandardAssets.CrossPlatformInput using UnityEngine.Networking public class TankController NetworkBehaviour Use this for initialization Header("Movement Variables") SerializeField float movementSpeed 5.0f SerializeField float turnSpeed 45.0f Header("Camera Position Variables") SerializeField float cameraDistance 16f SerializeField float cameraHeight 16f Rigidbody localRigidBody Transform mainCamera Vector3 cameraOffset void Start () if (!isLocalPlayer) Destroy(this) return localRigidBody GetComponent lt Rigidbody gt () cameraOffset new Vector3(0f, cameraHeight, cameraDistance) mainCamera Camera.main.transform MoveCamera() Update is called once per frame void FixedUpdate () float turnAmount CrossPlatformInputManager.GetAxis("HorizontalUI") float moveAmount CrossPlatformInputManager.GetAxis("VerticalUI") Vector3 deltaTranslation transform.position transform.forward movementSpeed moveAmount Time.deltaTime localRigidBody.MovePosition(deltaTranslation) Quaternion deltaRotation Quaternion.Euler(turnSpeed new Vector3(0, turnAmount, 0) Time.deltaTime) localRigidBody.MoveRotation(localRigidBody.rotation deltaRotation) MoveCamera() void MoveCamera() mainCamera.position transform.position mainCamera.rotation transform.rotation mainCamera.Translate(cameraOffset) mainCamera.LookAt(transform) I have also checked the auto create player in the spawn info as suggested in some solutions.
0
taking a static animation and making it move unity3d Say you have an animation of a bird flapping its wing. Some animations actually moves the Avatar either forward, backwards or to the side. My question is, is it possible to take that flapping animation and change the animation to make it move forward within the unity editor? Please note that i am not an animator which means that i do not have the skills to edit the animation in a 3rd party program. So this question revolves around what you can do in Unity3d
0
How do i move a 2D object with angle and speed variables in unity? I want to move an object with a certain angle and speed, is there a was to set this as an initial velocity so that it is still possible for the object to collide and bounce of other objects using its rigid body?
0
What controls the platform override codes in AudioClip (and maybe other Assets) .meta files? My game needs to use Unity 2019.3 for the console versions, and 2020.3 for the mobile ports. The Console Project is the master project. Virtually any changes done to it are replicated to the Mobile project. I would like to setup import overrides for Android (e.g. the compression quality for my soundtracks). To be consistent, I perform this change in my Console Project using the quot Override for Android quot checkbox (which affects the .meta file), and then replicate the change to the Mobile Project (a program checks for differences between both projects and applies most changes). Ideally, the Mobile Project will now reflect the compression quality I want for said soundtracks, but it actually doesn't in fact, the quot Override for Android quot checkbox does not appear to be checked in the Mobile Project, despite having a .meta file identical to the Console Project. I digged into the .meta files, and noticed that when I use quot Override for Android quot in my Console Project, the .meta file adds an entry code 27 platformSettingOverrides 27 loadType 2 sampleRateSetting 0 sampleRateOverride 44100 compressionFormat 1 quality 0.5 conversionMode 0 But, when I go to my Mobile Project and check the checkbox, it adds an entry coded 7 platformSettingOverrides 7 loadType 2 sampleRateSetting 0 sampleRateOverride 44100 compressionFormat 1 quality 0.5 conversionMode 0 I don't understand this inconsistency. Does anyone have any insight on the exact conditions rules Unity uses for the platform codes in the .meta files? I can only think of a few dubious reasons Maybe they changed from 2019 to 2020. My Console Project actually supports more platforms than the Mobile Project (the consoles, obviously), so maybe they quot pushed quot the Android code from 7 to 27. It is not the end of the world I could make a script that duplicates the settings of 27 into 7... But only if this behaviour is predictable or consistent. So my question is, what is Unity's logic behind the choice of these platform codes? Note so far I've only found this behaviour on AudioClip files. With Textures, I see that it actually uses the name of the platform in the .meta file, so the settings do work thankfully, but it is even more puzzling because now I don't understand why Textures and AudioClips use different conventions to begin with... What other Asset Type has numeric conventions?
0
How to use AssetBundles with Unity WebGL I have a Unity WebGL project that tries to load AssetBundles, but I get an error Unable to open archive file http localhost 50212 StreamingAssets Bundles language english The code that creates the AssetBundles using UnityEditor using System.IO using UnityEngine public class JC Bundler Editor MenuItem("Assets Build AssetBundles") static void BuildAllAssetBundles() string path Path.Combine(Application.streamingAssetsPath, JC Bundles.Directory) if (!Directory.Exists(path)) Directory.CreateDirectory(path) BuildPipeline.BuildAssetBundles(path, BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget) AssetDatabase.Refresh() I can see the AssetBundles do get created and it works on other Windows Standalone and Android platforms. The code that read the AssetBundle public void PrepareLanguageAssets(SystemLanguage language, UnityAction onDone, UnityAction onFail) StartCoroutine(LoadBundle("language " language, bundle gt if (bundle null) onFail() else if (languageBundle) languageBundle.Unload(true) languageBundle bundle onDone() )) public void LoadLanguageAsset lt T gt (String name, UnityAction lt T gt callback) where T UnityEngine.Object StartCoroutine(LoadAsset(languageBundle, name, callback)) IEnumerator LoadAsset lt T gt (AssetBundle bundle, string objectNameToLoad, UnityAction lt T gt callback) where T UnityEngine.Object AssetBundleRequest asset bundle.LoadAssetAsync lt T gt (objectNameToLoad) yield return asset callback(asset.asset as T) So when I switch my Unity Editor Platform to WebGL and do a "Build And Run" with the same project I see the above mentioned error. How can I load AssetBundles in WebGL?
0
Inconsistent CapsuleCast Collision behavior when a GameObject is selected My gameobject has a CapsuleCollider and I use CapsuleCast to check for horizontal collisions when moving horizontally so the gameobject won't pass thru obstacles. It works 100 of the time except when I select the gameobject in Hierarchy. When I have the gameobject selected, whenever I try to bump a wall continuously, it shakes jitters until it eventually goes thru the wall. But this only happens when I have the object selected in Hierarchy. If I click on the scene so that the object is not selected and do the exact same thing (bump a wall continuously), there is no shaking jitter and it doesn't pass thru the wall no matter how long I bump it. This passing in the wall when selected is also consistent. Hundred percent of the time it will pass thru when I have it selected (and does the shaking) and also hundred percent of the time it doesn't if I don't have the object selected. Shouldn't selecting an object don't have any effect on this? Please give me some ideas of why.
0
Lat, Lon and elevation Conversation into unity coordinates I have came across a very vague project problem and its feasibility report or communication procedures I have to define. And here is the current scenario I have two applications One is built on Unity3d (which is under my control) The second is also an application (which i don't know, and not under my control ) but it is related to a map service app. Now the actual thing I want to do is that If a user click in the map application than, the touch should be recognize in the unity application too. Suppose I have able to communicate with both applications and the map application providing me the latitude, longitude and elevation information on click. Now the question is how do I convert its lat, lon and elev into my project work space unity coordinates?. I found 3D coordinates on a sphere to Latitude and Longitude, and its about sphere. I don't have sphere I have an environment where different models are placed precisely according to map (there is no dummy models, all are accurate) and the map projection is based on snake grid.
0
InvalidOperationException in build only, when trying to select object in a dynamically loaded scene using Linq Here is the relevant code private void Awake() StartCoroutine(LoadScenes()) private IEnumerator LoadScenes() this.sceneLoad1 SceneManager.LoadSceneAsync(Scene1, LoadSceneMode.Additive) while (!this.sceneLoad.isDone) Debug.Log("Loading scene 1...") yield return null this.sceneLoad2 SceneManager.LoadSceneAsync(Scene2, LoadSceneMode.Additive) while (!this.sceneLoad.isDone) Debug.Log("Loading scene 2...") yield return null private void Start() SceneManager.GetSceneByName(Scene1) .GetRootGameObjects() .Where(root gt root.GetComponent lt God gt () ! null) .Select(root gt root.GetComponent lt God gt ()) .Single() .SpreadGospel() (Scene1 and Scene2 are const strings.) The program works fine when running in the Unity editor. However, when I make a development build, I see the follow error message InvalidOperationException Operation is not valid due to the current state of the object at System.Linq.Enumerable.Single God (IEnumerable 1 source) 0x00057 in Users builduser buildslave mono build mcs class System.Core System.Linq Enumerable.cs 1968 at MySolution.GodInitializer.SpreadGospel () 0x00001 in D repos MySolution SourceCode SourceCode GodInitializer.cs 100 at MySolution.GodInitializer.Start () 0x00012 in D repos MySolution SourceCode SourceCode GodInitializer.cs 77 ... which indicates that the scene wasn't fully loaded before I tried to access the God singleton. What changes should I make to fix the problem?
0
Saving Information in Byte sorry for the unhelpful title. I'm trying to understand how to convert information to bytes so that I can save it using Google's Saved Games feature that comes with Play Services, as explained here. https codelabs.developers.google.com codelabs playservices unity index.html?index .. 2F.. 2Findex 9 I've mostly copy pasted the code but it's not really working out for me. However, my initial question is about bytes. So it looks like Google stores game information in bytes . The example only shows a single int being converted to byte and then being saved. What if I wanted to save multiple integers in Google's Saved Game services? I'm not exactly sure what this byte array is in the first place and how everything can be converted to bytes. If anybody has any good resources or examples, it would be much appreciated! Thank you
0
Draw "rasterize" irregular circle onto a 2D grid I'm using the midpoint circle algorithm to choose cells on a 2D grid which outline a circle. However, I need to incorporate some random noise so that I get an irregular circle, and this method won't work anymore given how it works. Another stack exchange answer describes an equation (the "pink noise" example) I'd like to try but I'm not sure on the best approach to implement it. I can replicate the equation via code, but I'll need to start choosing grid cells coordinates differently and I'm not sure the best solution. How can I "rasterize" an irregular circle like this?
0
How to add Facebook Data Storage to Mobile Game? I was wondering how I would add the option for players to sign into their Facebook profiles on my mobile game and then have Facebook store their game save data, so they can recover it on any device when they sign into Facebook. Other Facebook features would include seeing their friends on the Facebook leaderboards, inviting their friends to the game and challenging their friends to beat their scores. I would hate for the Player's data to be lost, so the Facebook data save part is very important. A good reference to this feature is the Hungry Shark mobile game. I wasn't sure how this works. My programming friend and I are creating the game together, but he doesn't know how to do this and I don't know how to program. Once I figure out exactly what has to be done, I would like to hire a programmer who knows how to add this feature. Thank you!
0
Import Unity 2D objects in Libgdx I'm using Libgdx to do some simple home projects. I'm trying to make a simple 2D game with Box2d using R.U.B.E as editor. I create a 2d terrain in R.U.B.E now I want to create the terrain texture. I see this tool for Unity https www.assetstore.unity3d.com en ! content 15761 This type of tool is exactly what I need for terrains. What I want to know is not related with this specific tool, but I wan't to know if I can import Unity 2d objects generated by tools related to Unity in my Libgdx 2d games?
0
How can I more efficiently paint grass onto a large terrain object in Unity? I'm trying to paint a grass onto a large terrain and I want it to cover the entire terrain. Since the brush size can't go past 100 it would seem that I'm stuck painting the entire thing with a small brush relative to the terrain size. How can I more efficiently paint grass onto a large terrain object?
0
Second Animation is not working after Collision? I want to show an accident of Character with car. so I wrote this code and in update function I wrote this... if (Once) Criminal.GetComponent lt Animation gt ().Play ("Running") after collision This animation will work Criminal.GetComponent lt BezierMover gt ().enabled true TrafficCar.GetComponent lt BezierMover gt ().enabled true void OnCollisionEnter (Collision col) if (col.gameObject.tag "Vehicle") if (!Criminal.GetComponent lt Animation gt ().IsPlaying ("Stumbling")) Criminal.GetComponent lt Animation gt ().Play ("Stumbling") Animation for Accident Criminal.GetComponent lt BezierMover gt ().enabled false to Deactivate the AI Script. TrafficCar.GetComponent lt BezierMover gt ().enabled false to Deactivate the Trrafic cars Path Script. Once true but after first animation second animation should work but this is not happening..
0
Mesh made in Blender is correct in Unity3D as a rendered mesh, but "empty" as a collider? I created a simple stair "block" in Blender, and it's rendered correctly, but when I tick "Generate Colliders" and try to use it in a Mesh Collider, there is nothing. (Ps. I need the real mesh as a collider, not just that generated convex one) Maybe a good clue is that my other objects' generated colliders are smaller than the rendered meshes themselves. Maybe this one is scaled to zero? After triangulating And via Unity's automatic triangulation (the original, non triangulated blender model)
0
Instantiated Object returns Null outside Start method I'm attempting to access an instantiated 'goalTemp' GameObject from a different function inside the same script. I'm getting the information in the Start method, assigning the GameObject find get component script code to a variable. When I'm printing the results outside the Start method, it returns null, even though the 'goal' variable is public. void Start() GameObject goalTemp (GameObject)Instantiate(goal,respawnGoalLocation CreateLevel.currentLevel 1 ,Quaternion.identity) goal goalTemp.gameObject public void Explode() Debug.Log(goal) Instantiate(rockParticle, goal.transform.position, goal.transform.rotation) Instantiate(explosionParticle, goal.transform.position, goal.transform.rotation) What am I doing wrong here? Thanks for your time!
0
How can I keep vertex order the same on every Instantiate()? While trying to resolve another question, I have discovered that if I Instantiate() from a prefab, the order of the mesh vertices (and therefore triangles) is inconsistent between instances. This is apparent, for example, if I RaycastHit.triangleIndex the same location on the mesh on different runs of the game. The same location returns the same triangle index during one run of the game, but a different triangle index in the next run. If instead I add the model to the scene in the editor, and then run the game, the same location returns the same triangle index in every run of the game. If I duplicate the model through the scene editor, the duplicate also returns the same triangle index. This is the behaviour I am aiming for. However, I would obviously prefer to Instantiate at runtime. (This would allow me flexibility on when and how many models to instantiate, and in the long run I want to add other models too. The alternative is to add the model to the scene and create a large number of "offscreen" duplicates, which seems prone to inefficiencies on multiple fronts.) Is it possible to use Instantiate and maintain a consistent vertex triangle order between instances and between runs of the game?
0
How can I have a Mecanim animation with displacement and physics? I have 3D wolf models from my animator with displacement (i.e the wolf transforms with animation, not in place). I have added rigid bodies to the models. I am facing following issues while executing them in my project When I turn on IsKinematic on my rigid body (i.e disable physics) the animations work perfectly, with displacement. But I need to have physics enabled on my wolf because it doesn't detect collision when physics is disabled and gravity doesn't have any impact. When turn off IsKinematic (i.e enable physics), the animations don't work the wolf start wobbling and flying in the air. How can I resolve this?
0
Show Camera Inside Object Bounds I'm making a mobile game, and I want have secondary camera that shows another part of the scene within a box. I'm able to do this easily enough by setting the camera's viewport settings, but the issue I'm having is when you change the screen size, the camera size changes with the screen no longer looking like it shows in the box (The box doesn't expand contract with the device's screen size). Is there a way to set the camera's size an position relative to a game object? This is what I'm trying to do
0
Programmatically generated mesh vertex colors not showing up in Unity? I'm sorry if this is an obvious thing to solve but I just can't figure it out...did I miss something...I've generated a mesh and during vertices generation I've also set its colors (and colors32 just in case) by reading those values from a ply file, and afterwards I've added a number of vertex color shaders but none of them will show the vertex point colors in play mode, it's either solid black or just like I added no material to the mesh (which I've tried doing manually in play mode too). Did I miss something please?
0
How do I duplicate the functionality of ugui's onClick (button component) in inspector (Unity)? I'm trying to create the same functionality that occurs when you are working with a button in uGui in Unity. I know that I have to create a custom inspector, but i'm not sure where to go from there. Essentially the functionality allows you to drag and drop a script to it's on click portion in the inspector, and then it gives you a list of functions for that script to select. This may sound a little confusing, so here are a few pictures demonstrating the functionality i'm trying to replicate. As you can see above the functionality allows you to drag in a script, select a function to link, and do this for as many or as little scripts as you want by pressing the or buttons on the bottom right. Thanks for any help in advance!
0
Is there no UI culling for unity? I don't understand, am I missing something? I have hundreds of moving images on screen that only need to render and do their logic physics when they are in the canvas. Otherwise they can just deactivate to save on performance and there is a very big fps difference when they are deactivated vs activated outside the canvas. RectMask2D on the canvas does barely anything. Checking the bounds for hundreds of UI elements seems like madness. So what are you supposed to do?
0
Problems exporting meshes to Unity 5 After creating a tree (Scots Pine) in SpeedTree Cinema v7.1.1 I exported it as a .FBX ascii file to Unity 5 and I encountered a problem the leaf material, while viewing it in Unity 5, can only be seen when I view the tree from the top, but when I view the tree from the bottom or the side, the leaves dissapear, they're not visible anymore, but on the other side, I can view the leaves of the tree from any angle in SpeedTree Cinema v7.1.1. I don't know if the problem is one of the following The way I export the tree (.FBX ascii) The way the texture is saved (.tga, .jpg, .png) The material settings (in SpeedTree or Unity) So you can better understand, i'll show the following images Description of images is below (Image 1.) Here are the setting of how I export the tree and you can also see the clearly see the leaves from all angles. (Image 2.) Here is my tree (the tall one, Scots Pine) and you can't see the leaves from underneath and the material displayed on the right belongs to the leaves of my tree (the tall one, Scots Pine). The tree to its side(the small one) is how I would like the leaves to look ( i didn't make the small tree). (Image 3.) In here you can see the leaves of my tree (tall one, Scots Pine) from the top, and next to my tree is another one (not my tree) which is how i would like my trees leaves to look. The material displayed on the right are from the small tree (not my tree). Any help is appreciated, thank you.
0
Unity settings overlapping other settings error In my unity game, I am using the amazing unity asset aura volumetric lighting and when I add its script into my camera this happens Yeah... I can't see anyone else who got these settings overlapping each other on the stack exchange or anywhere else. Not only does it overlap but I can actually change its settings and the camera settings if I click in the right areas! I restarted unity but it still doesn't fix anything. Please help. Thanks in advance!
0
Detect which tile in a tile palette a player is colliding with I have a megaman style platformer that I've been working on for a while now. I'd like to have my scene set up so that when a player interacts with certain tiles, it will have some sort of effect on the player. This could easily be achieved with creating individual sprites for the aforementioned interactables, but I'd ideally like to be able to have a portion of my script handle it so that everything besides the player and enemies would be tilemaps. For instance, I have a tile that would act as a treadmill that moves the player along in one direction. Another tile would be bouncy, and another would deal damage. I have the game set up right now to detect when the player is touching a tile, but I have no way of being able to tell which tile the player is touching. Is there a way to be able to compare programmatically which tile from a tile palette my player's hitbox is currently touching?
0
How do I create a single tile in Unity 2019 I going through the "Ruby's Adventure 2D Beginner" tutorial, chapter 4, section 3 with Unity 2019.11. In the tutorial you create a folder for tiles and you are then supposed to right click in the asset folder and select "Create Tile" from the menu. There's even a screenshot showing the menu where the option is right below the sprite sections. However, in version 2019.11 of unity, there is no such option ) I checked the documentation, and for 2019.3 and 2020.1 the manual states that this should be possible via the assets menu (there's no docs for 2019.11 specifically), but my Unity editor doesn't have the option. It seems unlikely that the option is just missing from my version, so I'm guessing something about my project setup is wrong. Is there anything special I need to set up to have the project support tiles? Edit I found the feature in the 2018 LTS version. I'm new to Unity, so maybe out of date documentation is the norm.
0
Algorithm for creating mesh from 2D image silhouette I'm looking for an algorithm that can take a 2D image, approximate it's shape and then generate a low poly mesh. Basically, the same what Unity does with sprites when you select tight mesh instead of a rect mesh. I'd be very thankful for any links that would put me on track to begin my research. Thanks!