Jump to content
Sign in to follow this  
4

enableCollisionWith and setMass don't make the player block the football/soccerball

Recommended Posts

I'm finished with my soccer RPG game and I'm tweaking stuff here, but I noticed recently that the ball absolutely refuses to be blocked by any of the infantry vehicle classes.

Literally anything else (apart from the Object-Helper vehicle classes) blocks it fine, though.

I've tried enableCollisionWith and I've tried setMass to everything from 0 to 50 000 and yet despite that this damn Land_Football_01_F refuses to acknowledge collision (i.e. for the purpose of bouncing off of them) with the player (especially when it's moving). Thus, it's not possible to block any shots or passes or loose balls at all. Kind of defeats the purpose of defense and goalkeepers because it turns the game into a "spam the tackle button" contest.

The only progress I've made, which is negligible at best, is that for extremely large values of setMass (i.e. 1 000 and above), the ball seems to knock the players unconscious if the ball is traveling fast enough... but that's it.

Does anyone happen to know how to get around this issue?

Edited by 4

Share this post


Link to post
Share on other sites

Try to attach some little VR Cubes to the player like 3 on top of each other to cover the player model.

If this works, you can hide them.

Share this post


Link to post
Share on other sites
If this works, you can hide them.

Doesn't hiding disable collisions? At least it ruins some physics.

Share this post


Link to post
Share on other sites

As far as i know in Arma 3 hiding a object does not disable the collisions, but attachTo could probably disable it but im not sure.

Share this post


Link to post
Share on other sites

The idea sounds great in theory but it seems that after attaching the object to my "Pelvis" hardpoint, the other guy was right in that the cube doesn't collide anymore with the ball.

enableCollisionWith also doesn't seem to matter here, too.

So while it was a smart idea, unfortunately it doesn't work in practice. :c

Edited by 4

Share this post


Link to post
Share on other sites

Well, you could try to do something with the velocity vector of your ball, the vector from the ball to the player and then decide if he is just kicking it or if he is blocking it like:

1. If the velocity vector of the ball is allmost the same as the vector from your ball to your player and the distance is around 0.3m, he is blocking it.

2. If the velocity vector is outside of the above case but still 0.3m near player he is kicking it.

You could add even more to it, so if the first case is true you could check the velocity vector of your player so if the velocity is above some value he is trying to immediately kick it even thought he is in the blocking case.

But i don't know if you want something like this, just a idea.

Share this post


Link to post
Share on other sites

Are the player models vanilla A3? Or did you make some? If so you could try a custom GEO lod?

Share this post


Link to post
Share on other sites
Are you trying to make MP or SP mission?

I want it to be MP, of course. I can't be bothered to write soccer AI, much less for goalkeepers as well.

The thing is pretty much done at this point. It's just that if I can't find a way to get players to block the ball with their bodies, then I'll probably have to make a moving target be the goalkeeper. This will probably cause a lot of lag, though, because of all the setPos stuff (unless there's an easier way to do it that I'm not aware of...).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×