|
|
|
|
Reply From: |
Cryingpants |
Sure you can, there is a method called set_bounce ( float bounce )
in RIgidBody2D and 3D. You can set your bounce in body_enter
signal by checking the body object included.
Thanks for the answer, but a static body does not have a contact_monitor. Does it?
No I don’t think so, but you can attach the script to your RigidBody and maybe check for a name or if you have more objects which should set the bounce to 0 then you can stick them all to a group and check if the body is in that group.
Or maybe add Area2D on top of that StaticBody and attach script to it.
Cryingpants | 2016-08-07 08:25
Thanks, that makes sense, but I’m new to scripting, and I’m afraid I can’t pull that off (not even sure how to check for a name). Adding a 2d area on top seems interesting too. I will try to do something with the information you gave me:)
Ps. If you know of any more material or examples I can use to learn about those functions/methods, I would be much obliged. My game is 3d.
Well I supose that you have a script attached to your RigidBody so if you connect body_enter signal to that node, then you will get a method with parameter named body. After that I would do something like this (but that all depends on your game):
func body_enter(body):
if body.get_name() == "ground":
set_bounce(0)
ps. If you’d like to contact me in more personal way… so we don’t have to comment here, and you can ask me whatever you want, just write me what’s your prefered way of communication and I can help you and show you some more examples perharps
Cryingpants | 2016-08-07 19:44
Thanks for the refference. I will fiddle with it and see what I can get. If you want to contact me, we can eather use email or skype. My Skype name is sojanjanso, (or Sojan Janso) with the same profile picture.
Edit: it’s not working. The code works though (I tested it with an exit body trigger), but it never gets triggered on time when the collision occurs.
Sojan,
million thanks for your reply and share of your works.
orsondudley | 2016-08-23 14:11
I want some examples in order to get an complete conllition system, with these elements:
1- Collition of rigidboody for static models of my main scene.
2- Collition for dynamic models of ambientation of my scene (like destructibles walls, glass, windows…).
3- Collition of player interacction with other NPC (bullets, life, hits, get items, inventary).
If you can helpme easely with some fast example i would be pleased.
My mail is this one: fofoman70@gmail.com
RODGIMA | 2016-08-23 21:29