Posts

Showing posts with the label unity3d

How to exclude Firebase Messaging from Unity iOS builds, but not Android builds

Image
Clash Royale CLAN TAG #URR8PPP How to exclude Firebase Messaging from Unity iOS builds, but not Android builds I have a Unity project that builds for both Android and iOS. I want to integrate Firebase on my Android builds, but not for my iOS builds. Is there a way to exclude Firebase Messaging from the iOS builds completely, but keep it in for Android? I don't see the options to do so in the Firebase settings panel. I tried to unselect the Editor/iOS parts of the unity package when installing it, but I still get linker errors (when building my iOS app in Xcode) that reference missing Firebase directories. Thanks in advance, - cg By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Unity: Unabe to merge Android Manifests

Image
Clash Royale CLAN TAG #URR8PPP Unity: Unabe to merge Android Manifests I am trying to make Android game using Unity. where I m using two modules which will use Plugin/Android feature 1. sqlite.so 2. SimpleNotification.aar It's giving me error : TempStagingAreaAndroidManifest-main.xml:4:58-89 Error: Attribute application@icon value=(@mipmap/app_icon) from AndroidManifest-main.xml:4:58-89 is also present at AndroidManifest.xml:10:3-36 value=(@drawable/app_icon). Suggestion: add 'tools:replace="android:icon"' to element at AndroidManifest-main.xml:4:3-12:17 to override. After searching net for many hours, tried many things: 1. tools:replace="android:icon” in 2. xmlns:tools=http://schemas.android.com/tools in 3. targetSdkVersion set in player Settings enter image description here But I have few queries like 1. How to know min/target Android API level for my libraries like .aar file or .so file which I m using 2. I have no Android Manifest file in...

C# Reflection return method content as Delegate

Image
Clash Royale CLAN TAG #URR8PPP C# Reflection return method content as Delegate I would like to call functions using Reflection I want to make the following section static: var mi = Abilities.instance.GetType ().GetMethod (abilities[i].name, BindingFlags.Instance | BindingFlags.NonPublic) as MethodInfo; AbilityAction code = (AbilityAction)Delegate.CreateDelegate(typeof(AbilityAction), this, mi); And then call it: AbilityAction code = GetMethodInClass(abilities[i].name /*e.g. MegaJump*/, Abilities, AbilityAction); I have tried my best but it gives me alot of errors: public static Delegate GetMethodInClass<T, D>(string methodName, T sourceClass, D delegateType) where D : Delegate { var mi = sourceClass.GetType().GetMethod (methodName, BindingFlags.Instance | BindingFlags.NonPublic) as MethodInfo; return (D)Delegate.CreateDelegate(typeof(delegateType), this, mi); } Thanks in advance. This sort of code is pretty grody. Consider if you're not ...

i cant code in my ENTIRE System, IDE

Image
Clash Royale CLAN TAG #URR8PPP i cant code in my ENTIRE System, IDE i have a BIG PROBLEM! that making me Mad! i cant type any code (i mean i cant use Auto-Completion) in any IDE! i tried Ctrl+space (not working) i tried changing my WINDOWS to 10, 7, 8...! (not working) i tried everything... plz help, its about 2 month and still nothing! i'm going mad :( this issue crippled me, i cant use (mono Develop for unity) or other IDE's like VS-Code, or VS 15, 17! i'm really frustrated... in advance: (sry for my bad english) (and THANK YOU... ) By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Player Movement using joystick based on camera facing

Image
Clash Royale CLAN TAG #URR8PPP Player Movement using joystick based on camera facing I develop Offline FPS Multiplayer Game. When the Player Rotation value (0,0,0) then Player Move perfectly in Direction. but my problem is when i rotate the camera using touch input then player can also rotate his face and press to joystick button for move the player then player can not move the direction of camera facing. My Joystick Script For Player public class VirtualJoystick : MonoBehaviour, IDragHandler, IPointerUpHandler,IPointerDownHandler { private Image bgImg; private Image JoyStickImage; private Vector3 InputVector; private void Start(){ bgImg = GetComponent<Image> (); JoyStickImage = transform.GetChild (0).GetComponent<Image> (); } public virtual void OnDrag(PointerEventData ped){ Vector2 pos; if (RectTransformUtility.ScreenPointToLocalPointInRectangle (bgImg.rectTransform, ped.position, ped.pressEventCamera, out pos)) { pos.x = (pos.x / bgImg.rectTransfo...

Keep the correct lane on road

Image
Clash Royale CLAN TAG #URR8PPP Keep the correct lane on road I am trying to make a Traffic Simulator for my bachelor thesis. I created a map with OpenStreetMap osm and now i am trying to put some cars on roads. I created a graph for the roads. The graph is like this: A->B,C,D C->A,B,E B->A,C D->A E->C and I generate random the cars on random points A,B,C,D,E,F. After this i use function getShortestPath(start,end) to get the shortest path for every car and I put the cars to move: foreach(Car c in allCars){Move(c,path)} getShortestPath(start,end) foreach(Car c in allCars){Move(c,path)} But, i have a problem, i don't know how to keep the correct lane of road for every car, all my cars are on the same lane of road. I am thinking about the direction between two points and the car will be at the right side of the direction. But I have no idea how to do this.... Thank you! By clicking "Post Your Answe...

How to organize your scripts and GameObjects in game developement?

Image
Clash Royale CLAN TAG #URR8PPP How to organize your scripts and GameObjects in game developement? I work with Unity. My problem is sometime I'm not sure how to organize my scripts in folders and GameObjects in scenes. (gameobjects are basic spatial objects where you put on your scripts, scenes are the rooms for all gameobjects you want to load at runtime). I am confronted mostly with problems like: "Do I to create folder based on type of gameObject, then add in all scripts related to these gameObjects?" For example: Cameras ↳(CameraActivate, CameraFollow, CameraShakeOnReplay) Or "Do I to create folder based on type of technology, then add in all scripts related to this technology?" Replay ↳(ReplayTimeline, ReplayControl, ReplayShakeCamera) Are there rules for this kind of thing? There's probably some conventions specific to unity for this, but what you are generally speaking of is called Cohesion en.wikipedia.org/wiki/Cohes...

Unity3D - I can't make account creation system

Image
Clash Royale CLAN TAG #URR8PPP Unity3D - I can't make account creation system I'm trying to create an account creation system within Unity, but I run into the following error: error CS0246: The type or namespace name Response could not be found. Are you missing an assembly reference? Script NetworkConnection : public void CreateUser(string userName , string email , string pass , Action<Response> response){ StartCoroutine (Make_CreateUser (userName, email, pass, response)); } private IEnumerator Make_CreateUser(string userName , string email , string pass , Action<Response> response){ WWWForm form = new WWWForm (); form.AddField ("userName", userName); form.AddField ("email", email); form.AddField ("pass", pass); WWW w = new WWW ("http://localhost/game/createUser.php", form); yield return w; response (JsonUtility.FromJson<Response> (w.text)); } [Serializable] public class Respo...

Multithread Pathfinding, Unit can't receive path array result

Image
Clash Royale CLAN TAG #URR8PPP Multithread Pathfinding, Unit can't receive path array result I have a pathfinder program using A* that i made following a tutorial. It works fine until i tried to make it multithread using async Task. The Thread works and the path is calculated, but when the path result is being passed to the Unit object, for some resaon only one or two Unit that receive the path array. where did i do wrong ? RequestManager : public class ThreadRequestManager : MonoBehaviour { Queue<PathResult> results = new Queue<PathResult>(); static ThreadRequestManager instance; ThreadPathfinding pathfinding; private void Awake() { instance = this; pathfinding = GetComponent<ThreadPathfinding>(); } private void Update() { if (results.Count > 0) { int itemsInQueue = results.Count; lock (results) { for(int i = 0; i < itemsInQueue; i++) { PathResult result = results.Dequeue(); ...

Unity UDP - Can't send and receive at the same time?

Unity UDP - Can't send and receive at the same time? I've been trying to send coordinates of the players vector to the UDP server which is written in NodeJS. However, when I try to send the coordinates and receive them modified afterwards nothing shows. If I modify the server to send me info constantly, it works. Seems as if I can't send and receive at the same time. using System.Collections.Generic; using UnityEngine; using System; using System.Collections; using System.Net; using System.Net.Sockets; using System.Text; using System.Threading; public class PlayerBehavior : MonoBehaviour { private UdpClient udpServer; public GameObject cube; private Vector3 tempPos; private Thread t; public float movementSpeed; private long lastSend; private IPEndPoint remoteEP; void Start() { udpServer = new UdpClient(41234); t = new Thread(() => { while (true) { this.receiveData(); } }); ...