Collision: create dent on an object relative to impact position.

J

Johnathan

Guest
Okay I don't really know about how to go about explaining this so I will use an example of something that has happened to me recently.

A piece of hail fell from the sky and dented my car.

How would I go about programming so that when the obj_hail collides with object_car it creates an obj_dent relative to where it actually hit the car? Everything that I have tried either puts it in a fixed position (instance_position) or the obj_dent becomes hovering above the obj_car.
 

sp202

Member
Make obj_dent follow the car's position with an offset that doesn't make it look like it's hovering. If you're creating more than 5-10 dents, I'd recommend looking into surfaces too so that you don't end up with a whole bunch of decal type objects hogging resources.
 
J

Johnathan

Guest
2 questions.

1 car is not moving is follow position still best option.

2 the car has a parent because there are multiple cars when I use that it only goes to the first car.

Also I am using a delete after a few seconds so it is deleted after it's out of view.
 

sp202

Member
Even if the cars aren't moving you'll need to refer to the car's co-ordinates in order to position the dent correctly rather than having it hover. Your second point might not have to do with parents at all, post the code you have at the moment for the dents.
 
J

Johnathan

Guest
sorry for the delay had some family health issues on the home front. I don't actually have any working code. I was using instance_position but it was only putting in 1 spot at that point. but it was actually on the target at least after messing with the true/false. I am not sure how to use the offset just started using non- dragndrop. been using game maker documentation and has went well so far. until this.
 
Top