This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:tutorials:physics:raycasting [2022/05/08 18:44 (4 years ago)] – Minor edits iarwain | en:tutorials:physics:raycasting [2025/09/30 17:26 (4 weeks ago)] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 73: | Line 73: | ||
| {{ : | {{ : | ||
| - | Change the default [Object] section to use the ore.png texture (and make it smaller): | + | Change the default |
| <code ini> | <code ini> | ||
| Line 84: | Line 84: | ||
| </ | </ | ||
| - | Change the application to be a standard window so that you can easily get to the console window behind. We'll need to see our logging later. | + | Give that a quick run and you should get a rotating rock: |
| + | |||
| + | {{ : | ||
| + | |||
| + | Change the application to be a standard window so that you can easily get to the console window behind. We'll need be able to see our logging later: | ||
| + | |||
| + | <code ini> | ||
| + | [Display] | ||
| + | Decoration | ||
| + | ... | ||
| + | ... | ||
| + | </ | ||
| Add a body to the object so that physics will be enabled on it. Raycasts can only locate objects with bodies: | Add a body to the object so that physics will be enabled on it. Raycasts can only locate objects with bodies: | ||
| Line 114: | Line 125: | ||
| ShowDebug = true | ShowDebug = true | ||
| </ | </ | ||
| - | |||
| - | Give that a quick run and you should get a rotating rock with the physics debug border surrounding the object. | ||
| - | |||
| - | {{ : | ||
| Now to do the raycast on every frame. Add to the Update() function: | Now to do the raycast on every frame. Add to the Update() function: | ||