New answers tagged

1

If I understand your question correctly this can be done using a bit of vector math. I've created an example in Javascript so please keep in mind that many of the mathematical operations I'm doing here can be done in Unity really easily using the built-in classes and methods. The ball will follow your mouse when you hover it over the window. I recommend you ...


0

Instead of hard restrictions you can use opposing forces. You want to simulate a rubber band between the two objects. That sort of force can be simulated by applying a push every frame that equals "distance to object" to the power of "your rubber band's springiness". If you want to increase the effective distance that object A can travel away from object B ...


1

The animations and logic for attacks can be broken down into individual logical units and then sequenced via data files. For example, you might have code like this: AdvanceBehavior(entity, target, speed) FallbackBehavior(entity, target, speed) SoundBehavior(entity, sound_id) AnimateBehavior(entity, anim_id, speed) and then you can have a data file that ...


0

Turns out the answer has to do with alpha channels and the way they were being processed. I removed transparent pixels from the edges and it works as intended now.


0

This may be the same problem as this question on SO (haven't used TextureAtlas before so not entirely sure)


1

Should I have a base class for the battler which has all the common methods and than inherent each character from that class with its own attack sequences? If you have a lot of battler types, I don't think you would necessarily want them all to be their separate class if they are very similar to each other otherwise. One approach would be to have them all ...


0

Pretty old question, but I recently bumped into similar problem and solved it with few more lines of code to my shader. I don't know details of how transparency is handled by Unity when it uses sprite as a texture, but I decided to do same thing Unity does in their default shaders. You can download 'Built In shaders' from this page: https://unity3d.com/get-...


1

The problem is in your game loop You are limiting your rendering fps to your game world fps. You should update your world on a fixed timestep and either leave the render timestep to vsync or limit to something like 60.. You're using non floating point variable types where you should be using floating point math. This adds imprecision and can cause ...


0

I fixed it by changing the main update loop and i followed this ordrer Input Physics (World & Bodies) Camera (position & update) Graphics Box2D Renderer (if neeeded)


0

As far as I understand your problem, you can try the following. Firstly, depending on the screen resolution, you have to scale the background object so that it occupies the entire space. This can be done using the something like the following code. newWidth = Screen.width / textureSize; newHeight = Screen.height / textureSize; transform.localScale = new ...


1

This is an issue with any non 1x1 filter(such as a Gaussian one). If you don't want to clip, you can not apply the filter on the edge, or apply only part of it(and it will be darker probably). Another option, if the background outside the image, is known to be a specific color or transparency, is when you apply the filter, apply that color as part of the ...


2

We don't answer questions about which technology to use here, since it comes down largely to personal preference, compatibility with your studio's workflows, and the needs of an individual project. There is an on-topic question here though about the differences between animating individual body part sprites versus pre-rendering your frames to a spritesheet ...


0

That's pretty simple if you think about it. All you have to do is scale the sprite using a negative factor, which in the end will cause sides to mirror around it's origin. So all you have to do is assigning a negative scale using image_xscale: image_xscale = -1; The documentation page for image_xscale actually shows you an example with different scaling ...


1

Here's what I think is happening: the matrices in your static singleton sprite class (say that three times fast) -- specifically the model-view matrix -- is being modified on drawing every sprite without being reset to how it was before the modification. As such, any transformation you perform for one object is also applied to any subsequently drawn object ...



Top 50 recent answers are included