Tag Info

Hot answers tagged

4

Instead of testing the collisions ON the player, you should testing them AHEAD, to check whether there's a wall where the player WILL be walking. To do that, you'll only need to change 2 things: 1- Your player.collision function should accept two arguments: an x and y offset. You should add them to your collision checking algoythm too. 2- When calling ...


2

I don't think . But you can try to call a javacript like this (using Application.ExternalEval(.. ): <script type="text/javascript" language="javascript"> <!-- //initializing the WebPlayer var u = new UnityObject2(); u.initPlugin(jQuery("#unityPlayer")[0], "Example.unity3d"); function SaySomethingToUnity() { u.getUnity().SendMessage("MyObject", ...


1

Your slow down is probably caused because you take the Math.min(speed, distance) when distance is lower than your speed (implying that you can't move by your speed each frame (since it's dependant on the delta)). Your code does not allow me to see what causes the issue with the turn you are describing. To find out where exactly is your issue, I would ...


1

In your collision function, instead of returning a boolean, return a string so that you can detect each face: function colCheck(args) { if(obj2.y > obj1.y + obj1.height) { return "u" } if(obj2.y + obj2.height < obj1.y) { return "d" } if(obj2.x > obj1.x + obj1.width) { return "r" } if(obj2.x + ...


1

In the third iteration of the loop, pmx-i is equal to -1, map.FALL[-1] is undefined and undefined[pmy-1] is an error since you can't access an index of undefined.



Only top voted, non community-wiki answers of a minimum length are eligible