Greetings, I would like to make it possible to pick up objects, drag it and throw it. I 've tried different options but it doesn 't work . Maybe someone knows how to do it right. I tried to do something like in this video, but it still doesn’t work for me.
If you’re talking about print, then I generally don’t understand how it works. In some videos, they use it for verification, but when I use it, for some reason it is not displayed in my debug. I can throw off the current code that is there now, there are no lines to grab, but I can recreate them again for the purity of the experiment.
[/quote]
But you think that this video is completely suitable for the current version and I’m doing something wrong and I should do more research.
I can’t say what is the problem without knowing/seeing what exactly you’re having issues with. Hence my question about if you get the raycast interaction to work, as that would be a good starting point.
In the video that would be around the 5min mark, when the debug log prints “colliding with a rigidbody”
I’ve done everything. I understand that I wrote parts of the functions in the wrong places of the script. However, there is still a problem with throwing the object, it flies in an arc and I want it to be in front . the throw code looks like this
if Input.is_action_pressed(“kidat”):
if picked_object != null:
var knockback = picked_object.global_position - global_position
picked_object.apply_central_impulse(knockback * 5)
remove_object()