Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KinematicBody get_slide_collision() crashes. #11232

Closed
tofuhead opened this issue Sep 13, 2017 · 6 comments
Closed

KinematicBody get_slide_collision() crashes. #11232

tofuhead opened this issue Sep 13, 2017 · 6 comments
Labels
Milestone

Comments

@tofuhead
Copy link

tofuhead commented Sep 13, 2017

Operating system or device, Godot version, GPU Model and driver (if graphics related):
Kubuntu 17.04, Godot git MASTER

Issue description:
the new changes to KinematicBody api brings crashes when colliding. I do this:

if get_slide_count() > 0:
print("slide count: ", get_slide_count())
print(get_slide_collision(0))

and I get this on console:
slide count: 1
ERROR: operator[]: FATAL: Index p_index out of size (size()).
At: core/vector.h:137.

or am I doing something wrong? the get_slide_count is the new get_collision_count, right? atleast it will return 0 count when my character is still on air dropping to ground.

@tofuhead
Copy link
Author

tofuhead commented Sep 13, 2017

got this from gdb, if it helps.

#0  0x00005555567c19d2 in KinematicBody::_get_slide_collision(int) ()
#1  0x00005555567ce1df in MethodBind1R<Ref<KinematicCollision>, int>::call(Object*, Variant const**, int, Variant::CallError&) ()
#2  0x0000555556f581fb in Object::call(StringName const&, Variant const**, int, Variant::CallError&) ()
#3  0x0000555556f0bbc4 in Variant::call_ptr(StringName const&, Variant const**, int, Variant*, Variant::CallError&) ()
#4  0x0000555555c25cf6 in GDFunction::call(GDInstance*, Variant const**, int, Variant::CallError&, GDFunction::CallState*) ()
#5  0x0000555555c0cd78 in GDInstance::call_multilevel(StringName const&, Variant const**, int) ()
#6  0x00005555565abd57 in Node::_notification(int) ()
#7  0x00005555567c32e8 in KinematicBody::_notificationv(int, bool) ()
#8  0x0000555556f50d24 in Object::notification(int, bool) ()
#9  0x0000555556566ddd in SceneTree::_notify_group_pause(StringName const&, int) ()
#10 0x00005555565679da in SceneTree::iteration(float) ()
#11 0x0000555555b7d8c3 in Main::iteration() ()
#12 0x0000555555b76bd1 in OS_X11::run() ()
#13 0x0000555555b6fd1b in main ()

@groud groud added this to the 3.0 milestone Sep 13, 2017
@tofuhead
Copy link
Author

is this just me? should I put up a sample project?
thanks.

.b

@eon-s
Copy link
Contributor

eon-s commented Sep 23, 2017

A sample is always welcome for quick tests :D

@tofuhead
Copy link
Author

kinbug.tar.gz

here you go.

.b

@eon-s
Copy link
Contributor

eon-s commented Sep 23, 2017

I can't reproduce the crash with the sample project on 18e453b (current master).

Are you sure there is not an invalid access to the collision list somewhere else in your code?
It should not crash, though.

KB have changed a lot and those slide_count and slide_collision do not have the best names for a method 😵
These, if related to collisions, should be "collision count" and "collision data" 🙃

@tofuhead
Copy link
Author

thanks for looking into it.. I am not sure what happened, but I decided to wipe the whole source dir and clone the git repo again for totally clean build.. now it really seems to work. I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants